M.define("thread", function(a) {
	var b = function(c) {
		this.init(c)
	};
	M.object.merge(b.prototype, {
		init: function(d) {
			this.eventState = this.eventState || {};
			this.eventList = [];
			this.closeList = [];
			this.openList = [];
			this.time = 1000;
			if(M.object.isObject(d)) {
				if(d.time && M.object.isNumber(d.time)) {
					this.time = d.time
				}
				this.isStart = false;
				if(d.eventList && M.object.isArray(d.eventList)) {
					this.eventList = d.eventList
				}
				if(this.eventList.length > 0) {
					for(var c = 0; c < this.eventList.length; c++) {
						if(this.eventList[c].name) {
							this.eventState[this.eventList[c].name] = true
						} else {
							throw new Error("one eventName is null")
						}
					}
				}
			}
		},
		call: function() {
			var d = this;
			if(d.eventList.length > 0) {
				for(var c = 0; c < d.eventList.length; c++) {
					if(d.eventList[c] && d.eventList[c].event) {
						if(d.eventState[d.eventList[c].name]) {
							d.runFunction(d.eventList[c]);
							d.runObject(d.eventList[c])
						}
					}
				}
				for(var c = 0; c < d.closeList.length; c++) {
					d.eventState[d.closeList[c]] = false
				}
				for(var c = 0; c < d.openList.length; c++) {
					d.eventState[d.openList[c]] = true
				}
				d.openList = [];
				d.closeList = []
			}
			if(!d.stopThread) {
				d.threadId = setTimeout(function() {
					d.isStart = true;
					d.call()
				}, d.time)
			}
		},
		runFunction: function(e) {
			var d = this;
			if(M.object.isFunction(e.event)) {
				var c = null;
				if(e.source) {
					c = e.source
				}
				if(e.name) {
					d.eventState[e.name] = true
				}
				e.event.call(c, d.time)
			}
		},
		runObject: function(e) {
			var d = this;
			if(M.object.isObject(e.event)) {
				var c = null;
				if(e.source) {
					c = e.source
				}
				if(M.object.isObject(e.event) && M.object.isFunction(e.event.go)) {
					e.event.go.call(c, d.time)
				}
			}
		},
		start: function() {
			var c = this;
			if(!c.isStart) {
				c.threadId = setTimeout(function() {
					c.isStart = true;
					c.call()
				}, c.time)
			}
		},
		openOne: function(c, e) {
			var f = this;
			if(!M.object.isDefined(f.eventState[c]) && !f.eventState[c]) {
				if(!e) {
					f.eventState[c] = true
				} else {
					if(f.getOpenListIndex(c) == -1) {
						f.openList.push(c);
						var d = f.getOpenListIndex(c);
						if(d > 0) {
							f.openList.splice(d, 1)
						}
					}
				}
			}
		},
		closeOne: function(c, e) {
			var f = this;
			if(!M.object.isDefined(f.eventState[c]) && f.eventState[c]) {
				if(!e) {
					f.eventState[c] = false
				} else {
					if(f.getCloseListIndex(c) != -1) {
						f.closeList.push(c);
						var d = f.getCloseListIndex(c);
						if(d > 0) {
							f.closeList.splice(d, 1)
						}
					}
				}
			}
		},
		addOne: function(d, c) {
			var e = this;
			if(M.object.isObject(d)) {
				if(M.object.isObject(d) && d.name) {
					if(!c) {
						e.eventState[d.name] = true
					} else {
						e.eventState[d.name] = false;
						e.openList.push(d.name)
					}
					e.eventList.push(d)
				}
			}
		},
		getCloseListIndex: function(d) {
			var f = this;
			var c = -1;
			for(var e = 0; e < f.closeList.length; e++) {
				if(f.closeList[e] == d) {
					c = e;
					break
				}
			}
			return c
		},
		getOpenListIndex: function(d) {
			var f = this;
			var c = -1;
			for(var e = 0; e < f.openList.length; e++) {
				if(f.openList[e] == d) {
					c = e;
					break
				}
			}
			return c
		},
		stop: function() {
			var c = this;
			if(!c.isStart) {
				clearTimeout(c.threadId);
				c.stopThread = true
			}
		}
	});
	a.clazz = b
});
M.define("remoteStorage", function(b) {
	var a = function(c, d) {
		this.init(c, d)
	};
	M.object.merge(a.prototype, {
		init: function(c, e) {
			this.op = {
				WRITE: "W",
				READ: "R",
				DEL: "D",
				CLEAR: "X"
			};
			this._iframeLoadOver = false;
			this.origin = c;
			this.path = e;
			this._iframe = null;
			this._iframeReady = false;
			this._queue = [];
			this._requests = {};
			this._id = 0;
			if(!this._iframe) {
				var d = this;
				if(window.postMessage && window.JSON && window.localStorage) {
					this._iframe = document.createElement("iframe");
					this._iframe.style.cssText = "position:absolute;width:1px;height:1px;left:-9999px;";
					this._iframe.src = this.origin + this.path;
					document.body.appendChild(this._iframe);
					if(window.addEventListener) {
						this._iframe.addEventListener("load", function() {
							d._iframeLoadOver = true;
							d._iframeLoaded()
						}, false);
						window.addEventListener("message", function(f) {
							d._handleMessage(f)
						}, false)
					} else {
						if(this._iframe.attachEvent) {
							this._iframe.attachEvent("onload", function() {
								d._iframeLoadOver = true;
								d._iframeLoaded()
							}, false);
							window.attachEvent("onmessage", function(f) {
								d._handleMessage(f)
							})
						}
					}
				} else {
					throw new Error("Unsupported browser.")
				}
			}
		},
		get: function(c, f) {
			var d = this;
			var e = null;
			d._toSend({
				op: d.op.READ,
				key: c
			}, f);
			return e
		},
		set: function(c, e, f) {
			var d = this;
			d._toSend({
				key: c,
				op: d.op.WRITE,
				value: e
			}, f)
		},
		remove: function(c, e) {
			var d = this;
			d._toSend({
				key: c,
				op: d.op.DEL
			}, e)
		},
		removeAll: function(d) {
			var c = this;
			c._toSend({
				op: c.op.CLEAR
			}, d)
		},
		_toSend: function(e, f) {
			var d = this;
			e.count ? e.count++ : e.count = 1;
			if(e.count < 10) {
				if(!d._iframeLoadOver) {
					setTimeout(function() {
						d._toSend(e, f)
					}, 200)
				} else {
					var c = {
						request: {
							key: e.key,
							id: ++this._id,
							op: e.op,
							value: e.value
						},
						callback: f
					};
					if(d._iframeReady) {
						d._sendRequest(c)
					} else {
						d._queue.push(c)
					}
					if(!d._iframe) {
						d.init()
					}
				}
			} else {
				f(null, null)
			}
		},
		_sendRequest: function(d) {
			var c = this;
			c._requests[d.request.id] = d;
			c._iframe.contentWindow.postMessage(JSON.stringify(d.request), c.origin)
		},
		_iframeLoaded: function() {
			var e = this;
			e._iframeReady = true;
			if(e._queue.length) {
				for(var d = 0, c = this._queue.length; d < c; d++) {
					e._sendRequest(e._queue[d])
				}
				e._queue = []
			}
		},
		_handleMessage: function(c) {
			var e = this;
			var d = JSON.parse(c.data);
			e._requests[d.id].callback && e._requests[d.id].callback(d.key, d.value);
			delete e._requests[d.id]
		}
	});
	b.clazz = a
});
M.define("searchland", function(a) {
	var b = function(c) {
		this.init(c)
	};
	M.object.merge(b.prototype, {
		init: function(j) {
			var d = "searchland";
			this.formId = j.formId ? j.formId : "";
			this.submitId = j.submitId ? j.submitId : "";
			this.catelogyListId = j.catelogyListId ? j.catelogyListId : "";
			this.isHome = j.isHome ? j.isHome : false;
			this.renderId = j.renderId ? j.renderId : "";
			this.closeSearchLandBtnId = j.closeSearchLandBtnId ? j.closeSearchLandBtnId : "";
			this.claerKeywordBtnId = j.claerKeywordBtnId ? j.claerKeywordBtnId : "";
			this.keywordId = j.keywordId ? j.keywordId : "";
			this.searchPanelId = j.searchPanelId ? j.searchPanelId : "";
			this.keyword = j.keyword ? j.keyword : "";
			this.searchType = j.searchType ? j.searchType : "";
			this.keywordIsObj = false;
			this.isSo = false;
			if(M.object.isObject(this.keyword)) {
				this.keywordIsObj = true
			} else {
				this.keyword = M.string.decodeHtml(this.keyword)
			}
			this.searchHistoryLocalStorageName = "searchhistory_3";
			this.searchHistoryId = M.genId(d);
			this.hotSearchId = M.genId(d);
			this.hotSearchBtn = M.genId(d);
			this.clearHistoryId = M.genId(d);
			this.hotKeyWordId = M.genId(d);
			this.toastRootId = M.genId(d);
			this.toastnoId = M.genId(d);
			this.toastsureId = M.genId(d);
			this.historyContentId = M.genId(d);
			this.iscategory = j.iscategory ? j.iscategory : false;
			this.isHome = j.isHome ? j.isHome : false;
			this.localstorage = null;
			this.searchHistoryListIdList = [];
			this.hotKeyWordBtnIds = [];
			this.searchliIdList = [];
			this.searchliTagIdList = [];
			this.searchHistoryList = null;
			this.hotKeywordIndex = 0;
			this.searchLoop = false;
			this.openSearchLoad = false;
			this.isHistoryPanel = false;
			this.showFuncObj = j.showFuncObj ? j.showFuncObj : null;
			this.hideFuncObj = j.hideFuncObj ? j.hideFuncObj : null;
			if(window.location.href.indexOf("//so.m.jd.com") > 0) {
				this.isSo = true;
				this.localstorage = M.localstorage
			} else {
				var g = true;
				if(g) {
					try {
						window.localStorage.setItem("M_test", 1)
					} catch(h) {
						g = false;
						M.log("localStorage无法set", "error")
					}
					try {
						window.localStorage.getItem("M_test")
					} catch(h) {
						g = false;
						M.log("localStorage无法get", "error")
					}
					try {
						window.localStorage.removeItem("M_test")
					} catch(h) {
						g = false;
						M.log("localStorage无法remove", "error")
					}
				}
				var c = "so.m.jd.com";
				if(window.location.href.indexOf("https://") >= 0) {
					c = "https://" + c
				} else {
					c = "http://" + c
				}
				if(g) {
					this.isSo = false;
					this.localstorage = new(M.exports("remoteStorage").clazz)(c, "/solocalocalstorage.html")
				} else {
					this.isSo = true;
					this.localstorage = M.localstorage
				}
			}
			if(this.keywordIsObj) {
				var i = this.keyword.showWord ? this.keyword.showWord : "";
				if(this.keyword.keyword) {
					if(this.keyword.keyword != this.keyword.realWord) {
						var f = M.string.decodeHtml(this.keyword.keyword);
						$("#" + this.keywordId).val(f)
					} else {
						$("#" + this.keywordId).val("")
					}
				} else {
					$("#" + this.keywordId).val("")
				}
				$("#" + this.keywordId).attr("placeholder", i)
			} else {
				$("#" + this.keywordId).val(this.keyword)
			}
			$("#" + this.keywordId).addClass("hilight1")
		},
		mainHtml: function() {
			var d = this;
			var c = [];
			c.push('<div id="search_land_searchland" class="search-land">');
			c.push("</div>");
			return c.join("")
		},
		loadHotKeywordData: function(c) {
			var e = this;
			if(!e.hotKeyword) {
				M.http.ajax({
					url: "//so.m.jd.com/ware/hotKeyWord.action?_format_=json",
					xhrFields: {
						withCredentials: true
					},
					success: function(g) {
						if(g && g.hotKeyWord) {
							var l = g.hotKeyWord;
							try {
								l = JSON.parse(l);
								var k = l.def ? l.def : [];
								var f = l.owner ? l.owner : [];
								if(k.length > 0) {
									e.hotKeyword = k;
									if(f.length > 0) {
										for(var h = 0; h < f.length; h++) {
											if(f[h].hotWord && f[h].num && f[h].num <= k.length) {
												if(M.object.isString(f[h].hotWord)) {
													e.hotKeyword[f[h].num - 1] = f[h].hotWord
												}
											} else {
												if(M.object.isString(f[h].hotWord)) {
													e.hotKeyword.push(f[h].hotWord)
												}
											}
										}
									}
								} else {
									e.hotKeyword = [];
									if(f.length > 0) {
										for(var h = 0; h < f.length; h++) {
											e.hotKeyword.push(f[h].hotWord)
										}
									}
								}
							} catch(m) {
								e.hotKeyword = []
							}
						} else {
							e.hotKeyword = []
						}
						e.afterLoadHotKeywordData();
						var j = c.source ? c.source : null;
						c.func.call(j, e.hotKeyword)
					},
					error: function() {
						e.hotKeyword = [];
						c.func.call(d, e.hotKeyword)
					}
				})
			} else {
				var d = c.source ? c.source : null;
				c.func.call(d, e.hotKeyword)
			}
		},
		afterLoadHotKeywordData: function() {
			var c = this;
			if(c.isHome) {
				if(c.hotKeyword && c.hotKeyword.length > 10) {
					c.hotKeyword = c.hotKeyword.slice(0, 10)
				}
			}
		},
		loadHotKeyword: function() {
			var c = this;
			c.loadHotKeywordData({
				source: c,
				func: c.searchHotKeyHtml
			})
		},
		searchHotKeyHtml: function() {
			var g = this;
			var d = [];
			if(g.hotKeyword && g.hotKeyword.length > 0) {
				g.hotKeyWordBtnIds = [];
				d.push('<div id="' + g.hotSearchId + '" class="hot-search">');
				d.push('<div class="hot-search-head cf">');
				d.push("<p>热门搜索</p>");
				d.push('<i class="around-pic displayNone" id="' + g.hotSearchBtn + '"></i>');
				d.push("</div>");
				d.push('<div id="' + g.hotKeyWordId + '" class="hot-search-tags">')
			}
			d.push("</div>");
			d.push("</div>");
			$("#search_land_searchland").append(d.join(""));
			if(g.hotKeyword && g.hotKeyword.length > 0) {
				g.hotKeyWordBtnIds = [];
				var h = $("#" + g.hotKeyWordId).width() - 15;
				var e = h;
				var f = [];
				for(var c = 0; c < g.hotKeyword.length && c < 12; c++) {
					var j = "searchland_searchHotKeywordList_" + c;
					g.hotKeyWordBtnIds.push(j);
					g.hotKeywordIndex = c;
					f.push("<span>");
					f.push('<a href="javascript:void(0);" id="' + j + '"><i class="hot-search-move">' + g.hotKeyword[c] + "</i></a>");
					f.push("</span>")
				}
				$("#" + g.hotKeyWordId).html(f.join(""))
			}
			g.searchHotKeyBind()
		},
		searchHotKeyBind: function() {
			var d = this;
			if(d.hotKeyWordBtnIds.length > 0) {
				for(var c = 0; c < d.hotKeyWordBtnIds.length; c++) {
					$("#" + d.hotKeyWordBtnIds[c]).on("click", function() {
						var e = $.trim($(this).text());
						if(e != "") {
							var f = {};
							f.text = e;
							f.href = "//so.m.jd.com/ware/search.action?keyword=" + e;
							d.searchLandSubmit(f, "MSearch_HotWords")
						}
					})
				}
			}
		},
		searchLandHotKeywordRecursiveFade: function(c, g, d, f) {
			var h = this;
			if(d < f) {
				for(var e = d; e < f; e++) {
					if(e <= 2) {
						$(c[e]).find("i").addClass("move1")
					} else {
						$(c[e]).find("i").addClass("move2")
					}
				}
				setTimeout(function() {
					for(var j = d; j < f; j++) {
						if(j <= 2) {
							$(c[j]).find("i").text(g[j])
						}
					}
				}, 310);
				setTimeout(function() {
					for(var j = d; j < f; j++) {
						if(j <= 2) {
							$(c[j]).find("i").removeClass("move1")
						}
					}
				}, 500);
				setTimeout(function() {
					for(var j = d; j < f; j++) {
						if(j > 2) {
							$(c[j]).find("i").text(g[j])
						}
					}
				}, 410);
				setTimeout(function() {
					for(var j = d; j < f; j++) {
						if(j > 2) {
							$(c[j]).find("i").text(g[j]);
							$(c[j]).find("i").removeClass("move2")
						}
					}
				}, 750)
			}
		},
		searchHistoryHtml: function(j) {
			var c = this;
			var k = [];
			c.searchHistoryList = j;
			if(c.searchHistoryList != null && !M.object.isArray(c.searchHistoryList)) {
				c.searchHistoryList = null;
				c.localstorage.remove(c.searchHistoryLocalStorageName)
			}
			if(c.searchHistoryList && c.searchHistoryList.length > 0) {
				k.push('<div id="' + c.searchHistoryId + '" class="recent-search">');
				k.push('<div class="recent-search-head cf">');
				k.push("<p>最近搜索</p>");
				k.push('<i id="' + c.clearHistoryId + '" class="garbage-pic"></i>');
				k.push("</div>");
				k.push('<div id="' + c.historyContentId + '" class="recent-search-tags">');
				k.push("</div>");
				k.push("</div>")
			}
			k.push('<div id="' + c.toastRootId + '" class="search-toast displayNone">');
			k.push('    <div class="black-floor"></div>');
			k.push('    <div class="ground-toast">');
			k.push('        <div class="toast-content">');
			k.push("            确定要清空吗?");
			k.push("        </div>");
			k.push('        <div class="toast-btn">');
			k.push('            <a id="' + c.toastnoId + '" class="no">取消</a>');
			k.push('            <a id="' + c.toastsureId + '" class="sure">确定</a>');
			k.push("        </div>");
			k.push("    </div>");
			k.push("</div>");
			$("#search_land_searchland").html(k.join(""));
			if(c.searchHistoryList && c.searchHistoryList.length > 0) {
				var m = $("#" + c.historyContentId).width() - 15;
				c.searchHistoryListIdList = [];
				var l = m;
				var e = [];
				var f = null;
				var h = [];
				for(var g = 0; g < c.searchHistoryList.length; g++) {
					var d = "searchland_searchHistoryList_" + g;
					c.searchHistoryListIdList.push(d);
					h.push("<span >");
					h.push('<a id="' + d + '" searchland_index="' + g + '" href="javascript:void(0);">' + c.searchHistoryList[g].text + "</a>");
					h.push("</span>")
				}
				$("#" + c.historyContentId).html(h.join(""))
			}
			c.searchHistoryBind();
			c.loadHotKeyword()
		},
		searchHistoryBind: function() {
			var d = this;
			if(d.searchHistoryListIdList && d.searchHistoryListIdList.length > 0) {
				for(var c = 0; c < d.searchHistoryListIdList.length; c++) {
					$("#" + d.searchHistoryListIdList[c]).on("click", function() {
						var e = $(this).attr("searchland_index");
						var f = d.searchHistoryList[e];
						d.searchLandSubmit(f, "MSearch_HistoryRecords")
					})
				}
				$("#" + d.clearHistoryId).on("click", function() {
					$("#" + d.toastRootId).removeClass("displayNone")
				});
				$("#" + d.toastnoId).on("click", function() {
					$("#" + d.toastRootId).addClass("displayNone");
					d.sendMping("MSearch_ClearHistoryCancel")
				});
				$("#" + d.toastsureId).on("click", function() {
					d.sendMping("MSearch_ClearHistoryConfirm");
					d.clearHistory();
					$("#" + d.controlId).html("");
					$("#" + d.clearHistoryId).parent().parent().attr("style", "display:none;");
					$("#" + d.toastRootId).addClass("displayNone")
				})
			}
		},
		countWordWidth: function(j) {
			var e = {
				A: 9,
				B: 9,
				C: 9,
				D: 9,
				E: 9,
				F: 9,
				G: 9,
				H: 9,
				I: 9,
				J: 9,
				K: 9,
				L: 9,
				M: 10,
				N: 9,
				O: 9,
				P: 8,
				Q: 9,
				R: 9,
				S: 9,
				T: 7,
				U: 9,
				V: 8,
				W: 11,
				X: 9,
				Y: 9,
				Z: 9
			};
			var k = {
				a: 7,
				b: 7,
				c: 7,
				d: 7,
				e: 7,
				f: 7,
				g: 7,
				h: 7,
				i: 7,
				j: 7,
				k: 6,
				l: 7,
				m: 10,
				n: 7,
				o: 7,
				p: 7,
				q: 7,
				r: 7,
				s: 7,
				t: 7,
				u: 7,
				v: 7,
				w: 9,
				x: 7,
				y: 7,
				z: 7
			};
			var h = {
				".": 7,
				",": 7,
				"?": 7,
				'"': 7,
				"'": 7,
				")": 7,
				"(": 7,
				" ": 3
			};
			var c = {
				"1": 7,
				"2": 7,
				"3": 7,
				"4": 7,
				"5": 7,
				"6": 7,
				"7": 7,
				"8": 7,
				"9": 7,
				"0": 7
			};
			var f = 36;
			var d = 0;
			for(var g = 0; g < j.length; g++) {
				var l = j.charAt(g);
				if(e[l]) {
					d = d + e[l]
				} else {
					if(k[j.charAt(g)]) {
						d = d + k[l]
					} else {
						if(h[j.charAt(g)]) {
							d = d + h[l]
						} else {
							if(c[l]) {
								d = d + c[l]
							} else {
								d = d + 12
							}
						}
					}
				}
			}
			return d + f
		},
		searchLoadControl: function() {
			var d = this;
			var c = $("#" + d.keywordId).val().trim();
			if(c == "" && d.oldkeyword && d.oldkeyword != c) {
				d.oldkeyword = "";
				d.exposeDarkLines()
			}
			if(c == "" && d.searchLoop) {
				$("#" + d.claerKeywordBtnId).attr("style", "display:none;");
				if(!d.isHistoryPanel) {
					d.searchHistoryFromStorage({
						source: d,
						func: d.searchHistoryHtml
					});
					d.isHistoryPanel = true
				}
			} else {
				if(c != "" && d.oldkeyword != c && d.searchLoop) {
					$("#" + d.claerKeywordBtnId).attr("style", "");
					d.searchKeyLoad(c)
				}
			}
			setTimeout(function() {
				d.searchLoadControl()
			}, 500)
		},
		searchKeyLoad: function(c) {
			var d = this;
			d.searchLoop = false;
			d.oldkeyword = c;
			d.searchLocalStorage = false;
			M.http.ajax({
				url: "//so.m.jd.com/ware/tip.action",
				data: {
					keyword: c,
					_format_: "json"
				},
				success: function(f) {
					if(f && f.searchTipList && d.openSearchLoad) {
						var e = JSON.parse(f.searchTipList);
						if(e) {
							d.tipArray = e;
							$("#search_land_searchland").html(d.serchKeyHtml(d.tipArray));
							d.serchKeyBind()
						}
						d.searchLoop = true;
						d.isHistoryPanel = false
					} else {
						if(d.openSearchLoad) {
							d.searchLoop = true;
							d.isHistoryPanel = false
						}
					}
				},
				error: function(e) {
					if(d.openSearchLoad) {
						d.searchLoop = true;
						d.isHistoryPanel = false
					}
				}
			})
		},
		serchKeyHtml: function(n) {
			var c = this;
			c.searchliIdList = [];
			var e = [];
			if(n) {
				e.push('<ul class="association-normal">');
				var k = 0;
				if(n.attachInfoList && n.attachInfoList.length > 0) {
					for(var h = 0; h < n.attachInfoList.length; h++) {
						if(n.attachInfoList[h].attachType == "0") {
							var d = "searchland_attachInfoIdList_li_" + h;
							c.searchliIdList.push(d);
							var m = '"' + n.attachInfoList[h].searchQuery + '"店铺';
							e.push('<li searchland_type="2" searchland_index="' + h + '" id="' + d + '">');
							e.push('<a href="javascript:void(0);">');
							e.push('<i class="shop-pic"></i>');
							var l = "association-shop-name";
							e.push('<span class="' + l + '">' + m + "</span>");
							e.push("</a>");
							e.push("</li>")
						}
					}
				}
				if(n.wareList && n.wareList.length > 0) {
					for(var h = 0; h < n.wareList.length; h++) {
						var d = "searchland_li_" + h;
						c.searchliIdList.push(d);
						var m = n.wareList[h].wname;
						e.push('<li searchland_type="1" searchland_index="' + h + '" id="' + d + '">');
						e.push('<a href="javascript:void(0);">');
						var l = "association-product-name";
						e.push('<span class="' + l + '">' + m + "</span>");
						if(n.wareList[h].tag && n.wareList[h].tag.length > 0) {
							for(var g = 0; g < n.wareList[h].tag.length && g < 3; g++) {
								if(n.wareList[h].tag[g].tagsearchquery && n.wareList[h].tag[g].tagshowquery) {
									var f = M.genId("searchland_li_tag");
									c.searchliTagIdList.push(f);
									e.push('<span pingparam="' + (g + 1) + '" id="' + f + '" tagsearchquery="' + n.wareList[h].tag[g].tagsearchquery + '" class="association-product-btn">' + n.wareList[h].tag[g].tagshowquery + "</span>")
								}
							}
						}
						e.push("</a>");
						e.push("</li>")
					}
				}
				e.push("</ul>")
			}
			return e.join("")
		},
		serchKeyBind: function(d) {
			var e = this;
			if(e.searchliIdList.length > 0) {
				for(var c = 0; c < e.searchliIdList.length; c++) {
					$("#" + e.searchliIdList[c]).on("click", function(n) {
						var i = $(this).attr("searchland_index");
						var j = $(this).attr("searchland_type");
						var l = null;
						if(j == "1") {
							l = e.tipArray.wareList
						} else {
							if(j == "2") {
								l = e.tipArray.attachInfoList
							}
						}
						if(l && l.length > i) {
							var k = l[i];
							var m = {};
							var h = null;
							var g = null;
							if(j == "2" && k.attachType == "0") {
								h = "MSearch_Shopsearch";
								m.text = '"' + k.searchQuery + '"店铺';
								m.href = "//so.m.jd.com/shop/searchShop.action?keyword=" + k.searchQuery;
								g = {
									event_param: k.searchQuery
								}
							} else {
								if(j == "1") {
									h = "MSearch_SearchDropDownAssociationalWords";
									m.text = k.wname;
									m.href = "//so.m.jd.com/ware/search.action?keyword=" + k.wname;
									g = {
										event_param: k.wname + "_0"
									}
								}
							}
							e.searchLandSubmit(m, h, g)
						}
					})
				}
			}
			if(e.searchliTagIdList.length > 0) {
				while(e.searchliTagIdList.length > 0) {
					var f = e.searchliTagIdList.pop();
					$("#" + f).on("click", function(i) {
						var h = $(this).attr("tagsearchquery");
						var g = $(this).attr("pingparam");
						e.sendMping("MSearch_AssociationLabel", {
							event_param: g,
							event_level: "2"
						});
						e.searchLandSubmit(h);
						i.stopPropagation()
					})
				}
			}
		},
		sendMping: function(f, c) {
			if(f) {
				try {
					var g = new MPing.inputs.Click(f);
					if(c) {
						g = M.object.merge(g, c)
					}
					var d = new MPing();
					d.send(g)
				} catch(h) {}
			}
		},
		clearHistory: function() {
			var c = this;
			c.localstorage.remove(c.searchHistoryLocalStorageName)
		},
		searchHistoryFromStorage: function(c) {
			if(c.func) {
				var g = this;
				var f = c.source ? c.source : null;
				if(g.isSo) {
					var d = g.localstorage.get(g.searchHistoryLocalStorageName);
					d = JSON.parse(d);
					c.func.call(f, d)
				} else {
					try {
						g.localstorage.get(g.searchHistoryLocalStorageName, function(i, e) {
							var j = JSON.parse(e);
							if(g.isHome) {
								if(j && j.length > 10) {
									j = j.slice(0, 10)
								}
							}
							c.func.call(f, j)
						})
					} catch(h) {
						c.func.call(f, [])
					}
				}
			}
		},
		searchLandSubmit: function(k, d, i) {
			var c = this;
			var j = null;
			var g = null;
			var h = null;
			if(M.object.isObject(k)) {
				g = k;
				h = g.text
			} else {
				if(c.keywordIsObj && k == c.keyword.showWord) {
					if(c.keyword.realWord && $.trim(c.keyword.realWord)) {
						g = {};
						g.text = c.keyword.realWord;
						g.href = "//so.m.jd.com/ware/search.action?keyword=" + c.keyword.realWord;
						h = c.keyword.realWord;
						var e = {
							event_param: c.keyword.showWord + "_" + c.keyword.realWord
						};
						c.sendMping("MSearch_TrueLines", e)
					}
				} else {
					g = {};
					g.text = k;
					g.href = "//so.m.jd.com/ware/search.action?keyword=" + k;
					h = k
				}
			}
			if(g) {
				var f = {
					event_param: h
				};
				if(i) {
					f = i
				}
				var c = this;
				c.sendMping(d, f);
				setTimeout(function() {
					c.searchLandAddHistory(g, function() {
						$("#" + c.formId).attr("action", g.href);
						location.href = g.href;
						c.searchLoop = false
					})
				}, 200)
			}
		},
		searchLandAddHistory: function(e, c) {
			e.text = $.trim(e.text);
			var d = this;
			d.searchHistoryFromStorage({
				source: d,
				func: function(h) {
					var j = this;
					if(!M.object.isArray(h)) {
						h = null;
						j.localstorage.remove(j.searchHistoryLocalStorageName)
					}
					e.text = j.makeSearchName(e.text);
					delete e.tipNumber;
					if(h && h.length > 0) {
						var f = [e];
						for(var g = 0; g < h.length; g++) {
							if(f.length == 18) {
								break
							}
							if(h[g].text != e.text) {
								f.push(h[g])
							}
						}
						h = f
					} else {
						h = [];
						h.push(e)
					}
					j.localstorage.set(j.searchHistoryLocalStorageName, JSON.stringify(h));
					c.call(j)
				}
			})
		},
		homeSearchInfoAddHistory: function(f, c) {
			var d = this;
			if(d.isHome) {
				if(f) {
					var e = {};
					e.text = f;
					e.href = "//so.m.jd.com/ware/search.action?keyword=" + f;
					d.searchHistoryFromStorage({
						source: d,
						func: function(j) {
							var k = this;
							if(!M.object.isArray(j)) {
								j = null;
								k.localstorage.remove(k.searchHistoryLocalStorageName)
							}
							if(j && j.length > 0) {
								var g = [e];
								for(var h = 0; h < j.length; h++) {
									if(g.length == 18) {
										break
									}
									if(j[h].text != e.text) {
										g.push(j[h])
									}
								}
								j = g
							} else {
								j = [];
								j.push(e)
							}
							k.localstorage.set(k.searchHistoryLocalStorageName, JSON.stringify(j));
							if(!!c) {
								c.call(k)
							}
						}
					})
				}
			}
		},
		makeSearchName: function(c) {
			if(c.length >= 30) {
				c = c.substring(0, 30)
			}
			return c
		},
		searchTransformation: function() {
			var f = this;
			if(!f.openSearchLoad) {
				var c = $("body").children("div");
				$("body").removeClass("hide-landing");
				$("body").addClass("show-landing");
				$("body").addClass("history-color");
				if(!f.isHome) {
					$("#layout_appdown").attr("style", "display:none;")
				}
				for(var d = 0; d < c.length; d++) {
					if($(c[d]).attr("id") != "search_land_searchland" && !$(c[d]).attr("search_land_searchTransformation_show")) {
						$(c[d]).attr("style", "display:none;")
					}
				}
				$("body").children("footer").attr("style", "display:none;");
				if(f.showFuncObj && f.showFuncObj.func) {
					var e = f.showFuncObj.source ? f.showFuncObj.source : null;
					f.showFuncObj.func.call(e)
				}
				$("#" + f.searchPanelId).removeClass("on-blur");
				$("#" + f.searchPanelId).addClass("on-focus");
				window.scrollTo(0, 1);
				f.openSearchLoad = true;
				f.searchLoop = true;
				f.isHistoryPanel = false
			} else {
				$("body").removeClass("show-landing");
				$("body").removeClass("history-color");
				$("body").addClass("hide-landing");
				var c = $("body").children("div");
				if(!f.isHome && !$("#layout_appdown").attr("search_land_searchTransformation_show")) {
					$("#layout_appdown").attr("style", "")
				}
				$("#search_land_searchland").html("");
				for(var d = 0; d < c.length; d++) {
					if($(c[d]).attr("id") != "search_land_searchland" && !$(c[d]).attr("search_land_searchTransformation_show")) {
						$(c[d]).attr("style", "")
					}
				}
				$("body").children("footer").attr("style", "");
				if(f.hideFuncObj && f.hideFuncObj.func) {
					var e = f.hideFuncObj.source ? f.hideFuncObj.source : null;
					f.hideFuncObj.func.call(e)
				}
				f.openSearchLoad = false;
				f.searchLoop = false;
				f.searchLocalStorage = false;
				f.isHistoryPanel = false;
				f.oldkeyword = "";
				$("#" + f.controlId).html("");
				$("#" + f.searchPanelId).removeClass("on-focus");
				$("#" + f.searchPanelId).addClass("on-blur");
				$("#" + f.hotKeyWordId).show();
				$("#" + f.hotKeyWordheadId).show()
			}
		},
		exposeDarkLines: function() {
			var d = this;
			if($("#" + d.keywordId).attr("placeholder") && $("#" + d.keywordId).attr("placeholder").trim()) {
				var c;
				if(d.isHome) {
					c = "1"
				} else {
					if(d.iscategory) {
						c = "2"
					} else {
						c = "3"
					}
				}
				d.sendMping("MSearch_DarkLines", {
					event_param: c
				})
			}
		},
		render: function() {
			var c = this;
			if(M.object.isObject(c.renderId) || M.object.isArray(c.renderId)) {
				$(c.renderId).append(c.mainHtml())
			} else {
				$("#" + c.renderId).append(c.mainHtml())
			}
			$("body").addClass((c.isHome ? "mhome" : ""));
			$("body").addClass("hide-landing");
			$("#" + c.keywordId).on("click", function(g) {
				var d = null;
				if(c.isHome) {
					if(c.openSearchLoad) {
						d = "MSearch_Search"
					} else {
						d = "MHome_Search"
					}
				} else {
					if(!c.searchType) {
						if(c.iscategory) {
							d = "MFilter_Search"
						} else {
							d = "MProductList_Search"
						}
					} else {
						if(c.searchType == "pinpai") {
							d = "MSearchBrand_Search"
						}
					}
				}
				c.sendMping(d);
				if(!c.openSearchLoad) {
					if(c.landSearchWordHide) {
						$("#" + c.keywordId).val("")
					} else {
						var h = c.keyword;
						if(c.keywordIsObj) {
							h = c.keyword.showWord ? c.keyword.showWord : "";
							if(c.keyword.keyword) {
								if(c.keyword.keyword != c.keyword.realWord) {
									var f = M.string.decodeHtml(c.keyword.keyword);
									$("#" + c.keywordId).val(f)
								} else {
									$("#" + c.keywordId).val("")
								}
							}
							$("#" + c.keywordId).attr("placeholder", h)
						} else {
							$("#" + c.keywordId).val(h)
						}
					}
					if($("#" + c.keywordId).val() == "" && $("#" + c.keywordId).attr("placeholder") != "") {
						c.exposeDarkLines()
					}
					c.searchTransformation()
				}
			});
			$("#" + c.keywordId).on("keydown", function(f) {
				if(f.keyCode == "13") {
					var d = $.trim($("#" + c.keywordId).val());
					var g = $.trim($("#" + c.keywordId).attr("placeholder"));
					if(d == "" && g != "") {
						d = g
					}
					if(d != "") {
						c.searchLandSubmit(d, "MSearch_Searchthi")
					}
				}
				return
			});
			$("#" + c.closeSearchLandBtnId).on("click", function() {
				if(c.openSearchLoad) {
					c.searchTransformation();
					c.sendMping("MSearch_Back");
					var e = c.keyword;
					if(c.keywordIsObj) {
						e = c.keyword.showWord ? c.keyword.showWord : "";
						if(c.keyword.keyword) {
							if(c.keyword.keyword != c.keyword.realWord) {
								var d = M.string.decodeHtml(c.keyword.keyword);
								$("#" + c.keywordId).val(d)
							} else {
								$("#" + c.keywordId).val("")
							}
						} else {
							$("#" + c.keywordId).val("")
						}
						$("#" + c.keywordId).attr("placeholder", e)
					} else {
						$("#" + c.keywordId).val(e)
					}
					$("#" + c.keywordId).addClass("hilight1")
				}
			});
			$("#" + c.submitId).on("click", function() {
				var e = $.trim($("#" + c.keywordId).val());
				var f = $.trim($("#" + c.keywordId).attr("placeholder"));
				if(e == "" && f != "") {
					e = f
				}
				if(e != "") {
					var d = null;
					if(c.isHome) {
						if(c.openSearchLoad) {
							d = "MSearch_SearchButton"
						} else {
							d = "MHome_SearchButton"
						}
					} else {
						d = "MSearch_SearchButton"
					}
					c.searchLandSubmit(e, d)
				}
			});
			$("#" + c.keywordId).on("keyup", function() {
				if($(this).val() != c.keyword) {
					$(this).removeClass("hilight1");
					$(this).addClass("hilight2")
				} else {
					$(this).removeClass("hilight2");
					$(this).addClass("hilight1")
				}
			});
			$("#" + c.claerKeywordBtnId).on("click", function() {
				c.sendMping("MSearch_Clear", {
					event_param: ""
				});
				$("#" + c.keywordId).val("");
				$("#" + c.keywordId)[0].focus();
				$(this).attr("style", "display:none;")
			});
			c.searchLoadControl()
		}
	});
	a.clazz = b
});
M.define("Imglazyload", function(a) {
	var b = function(d) {
		this.init(d)
	};
	M.object.merge(b.prototype, {
		init: function(e) {
			var f = this;
			var d = e || {};
			f.defaults = {
				imgmp: {},
				sendindex: 8,
				scrollObj: window,
				refreshTimer: null,
				duration: 100,
				imgSrc: "imgsrc",
				container: "imgContainer",
				rangeH: 0,
				animationName: "fade",
				showDelay: "100ms",
				styleContianer: "styleID",
				errorImgSrc: "",
				isOpen: true
			};
			M.object.expand(f.defaults, d);
			f.duration = f.defaults.duration;
			f.container = f.defaults.container;
			f.imgSrc = f.defaults.imgSrc;
			f.rangeH = f.defaults.rangeH;
			f.isOpen = f.defaults.isOpen;
			f.animationName = f.defaults.animationName;
			f.showDelay = f.defaults.showDelay;
			f.styleContianer = f.defaults.styleContianer;
			f.scrollObj = f.defaults.scrollObj;
			f.imgmp = f.defaults.imgmp;
			f.sendindex = f.defaults.sendindex;
			f.baseId = "img_loading";
			if(f.refreshTimer) {
				clearTimeout(self.refreshTimer);
				f.refreshTimer = null
			}
			f.bind()
		},
		bind: function() {
			var d = this;
			$(d.scrollObj).on("scroll", function() {
				if(d.refreshTimer) {
					clearTimeout(d.refreshTimer);
					d.refreshTimer = null
				}
				d.refreshTimer = setTimeout(function() {
					d.lazyLad()
				}, d.duration)
			})
		},
		belowthefold: function(f) {
			var e = $(window).scrollTop();
			var d = this.rangeH;
			var h = $(f).offset().top;
			var g = $(f).get(0).offsetHeight + 2;
			return(e - d) <= (h + g)
		},
		abovethetop: function(d) {
			var e = this;
			return $(d).offset().top <= $(window).scrollTop() + document.documentElement.clientHeight + e.rangeH
		},
		inViewport: function(d) {
			var e = this;
			return e.belowthefold(d) && e.abovethetop(d)
		},
		setStyle: function(f, e) {
			for(var d in e) {
				f.style[d] = e[d]
			}
		},
		addStyle: function() {
			var d = document.getElementById(this.styleContianer) || document.getElementsByTagName("head")[0];
			var e = document.createElement("style");
			e.innerHTML += " @-webkit-keyframes fade { 0%   { opacity: 0; } 100%   { opacity: 1; }} @keyframes fade {  0%   { opacity: 0; }  100%   { opacity: 1; }}";
			d.appendChild(e)
		},
		squareImg: function(d) {
			$(d).each(function() {
				var e = $(this).height();
				if(e > 10) {
					$(this).css({
						width: e
					})
				}
			})
		},
		checkIphone: function() {
			var d = window.navigator.userAgent.toLowerCase();
			if(/iphone|ipd|ipod/.test(d)) {
				return true
			} else {
				return false
			}
		},
		setImgURL: function(f) {
			var k = this;
			var h = f[0].getAttribute("" + k.imgSrc + "");
			var e = f[0].getAttribute("src");
			var i = "";
			if(!!!h || e == "") {
				var j = f[0].outerHTML;
				console.log("Opps!Something Wrong!Please notice it!--:" + j)
			} else {
				i = h.replace(/http:/g, "")
			}
			var d = parseInt(f.width()) * 2;
			var g = parseInt(f.height()) * 2;
			if(d < 2 || g < 2 || !i) {
				return i
			}
			i = i.replace(/(s[0-9]{0,4}x[0-9]{0,4}_)?jfs/, "s" + d + "x" + g + "_jfs");
			if(!!i && i.indexOf(".webp") == -1 && !k.checkIphone()) {
				i = i + ".webp"
			}
			return i
		},
		changSrc: function(d) {
			var k = this;
			var j = $("#scwrapper").css("display");
			if(j != "none") {
				var i = d.attr("" + k.imgSrc + "").replace(/http:/g, "");
				var g = new Image();
				var f = i;
				var e = d.attr("imgtitle");
				var h = $(d).closest("li").hasClass("seckill-new-item");
				if(!!k.isOpen) {
					if((!i && e) || h) {
						f = i
					} else {
						f = k.setImgURL(d)
					}
				}
				d.css("opacity", 0);
				g.src = f;
				g.addEventListener("load", function() {
					d.attr("src", f).removeAttr("" + k.imgSrc + "").css("opacity", 1)
				}, false);
				g.onerror = function() {
					var l = this;
					d.attr("src", i).removeAttr("" + l.imgSrc + "").css("opacity", 1)
				}
			}
		},
		lazyLad: function(l) {
			var m = this;
			var k = [];
			var d = document.getElementById(m.container);
			if(d) {
				k = $(d).find("img[" + m.imgSrc + "]")
			} else {
				k = $("img[" + m.imgSrc + "]")
			}
			var h = l && !!rTimeArr;
			for(var j = 0, n = k.size(); j < n; j++) {
				currentObj = $(k[j]);
				if(m.inViewport(currentObj)) {
					currentObj.addClass("opa1");
					var g = currentObj.attr("" + m.imgSrc + "").replace(/http:/g, "");
					if(h) {
						try {
							var f = g.split(".com")[0];
							if(!!f && !!!m.imgmp[f]) {
								m.imgmp[f] = 1;
								rTimeArr[m.sendindex] = {
									sTime: new Date()
								};
								currentObj[0].currentindex = m.sendindex++;
								currentObj[0].addEventListener("load", function() {
									rTimeArr[this.currentindex].time = new Date()
								}, false)
							}
						} catch(o) {}
					}
					m.changSrc(currentObj);
					if(!!currentObj.attr("imgtitle")) {
						currentObj[0].onload = function() {
							var i = $(this).parent().is(".graphic-img") || $(this).parent().is(".show-img");
							if(i) {
								$(this).closest(".graphic-separation").find(".space-img").css({
									opacity: 0
								});
								var e = $(this).closest(".graphic-img").siblings(".graphic-text");
								if(e.length > 0) {
									e.css({
										opacity: "1"
									})
								}
							}
						}
					}
				}
			}
		}
	});
	var c = b;
	a.clazz = b
});
var slide = (function() {
	var a = function(c) {
		return new b(c)
	};

	function b(c) {
		this.elem = c;
		this.oBox = document.querySelector(c);
		this.aLi = document.querySelectorAll(c + " [data-ul-child=child]");
		this.oUl = document.querySelector(c + " [data-slide-ul=firstUl]");
		this.now = 0;
		this.on0ff = false
	}
	b.prototype = {
		init: function(c) {
			var e = this;
			var c = c || {},
				d = this.aLi;
			this.defaults = {
				imgSrc: "_src",
				startIndex: 0,
				loop: false,
				smallBtn: false,
				number: false,
				laseMoveFn: false,
				location: false,
				preDef: "lnr",
				autoPlay: false,
				autoHeight: false,
				preFn: null,
				lastImgSlider: false,
				playTime: 6000,
				mpingEvent: null,
				wareId: null,
				callback: null,
				isOpen: true,
				verticalCenter: false,
				fullScreen: true,
				total: 0
			};
			b.extend(this.defaults, c);
			e.imgSrc = e.defaults.imgSrc;
			e.isOpen = e.defaults.isOpen;
			this.now = this.defaults.startIndex;
			this.initBtn();
			this.liInit();
			this.bind();
			if(this.aLi.length < 2) {
				if(this.defaults.smallBtn) {
					this.oSmallBtn.style.display = "none"
				}
				if(this.defaults.number) {
					this.pageNub.style.display = "none"
				}
				this.defaults.autoPlay = false;
				this.defaults.loop = false
			}
			if(this.defaults.autoPlay) {
				this.pause();
				this.play()
			}
		},
		initBtn: function() {
			this.aLi = document.querySelectorAll(this.elem + " [data-ul-child=child]");
			var d = this.aLi;
			if(this.defaults.callback) {
				this.defaults.callback(1)
			}
			if(this.defaults.smallBtn) {
				this.oSmallBtn = document.querySelector(this.elem + ' [data-small-btn="smallbtn"]');
				this.oSmallBtn.innerHTML = this.addSmallBtn();
				this.btns = document.querySelectorAll(this.elem + ' [data-ol-btn="btn"]');
				for(var c = 0; c < this.btns.length; c++) {
					this.btns[c].className = ""
				}
				this.btns[b.getNow(this.now, d.length)].className = "active"
			}
			if(this.defaults.number) {
				this.pageNub = document.getElementById("page-nub");
				this.slideNub = document.getElementById("slide-nub");
				this.slideSum = document.getElementById("slide-sum");
				this.slideNub.innerHTML = (this.now + 1) % (this.aLi.length);
				this.slideSum.innerHTML = this.aLi.length
			}
			this.defaults.total = this.aLi.length;
			if(this.aLi.length == 2 || this.aLi.length == 3) {
				if(this.defaults.loop) {
					this.oUl.innerHTML += this.oUl.innerHTML
				}
				this.aLi = document.querySelectorAll(this.elem + " [data-ul-child=child]");
				this.need = true
			}
		},
		bind: function() {
			var f = this.oBox,
				e = b._device();
			if(!e.hasTouch) {
				f.style.cursor = "pointer";
				f.ondragstart = function(g) {
					if(g) {
						return false
					}
					return true
				}
			}
			var d = "onorientationchange" in window;
			var c = d ? "orientationchange" : "resize";
			window.addEventListener(c, this);
			if(this.aLi.length < 2) {
				if(this.defaults.smallBtn) {
					this.oSmallBtn.style.display = "none"
				}
				if(this.defaults.number) {
					this.pageNub.style.display = "none"
				}
				return
			}
			f.addEventListener(e.startEvt, this);
			window.addEventListener("touchcancel", this);
			if(navigator.userAgent.indexOf("baidubrowser") != -1) {
				window.addEventListener("focusin", this);
				window.addEventListener("focusout", this)
			} else {
				window.addEventListener("blur", this);
				window.addEventListener("focus", this)
			}
		},
		liInit: function() {
			var e = this.aLi,
				g = e.length,
				c = this.aLi[0].offsetWidth,
				k = this.aLi[0].offsetHeight,
				o = this.oUl,
				n = this.oBox.offsetWidth,
				d = 320,
				f = this.now,
				m = this;
			if(this.defaults.preFn) {
				this.defaults.preFn()
			}
			for(var j = 0; j < g; j++) {
				b.setStyle(e[j], {
					WebkitTransition: "all 0ms ease",
					transition: "all 0ms ease",
					height: "auto"
				})
			}
			if(this.defaults.fullScreen) {
				o.style.width = n * g + "px";
				if(this.defaults.autoHeight) {
					d = this.oBox.offsetWidth;
					if(d >= 640) {
						d = 640
					}
					for(var j = 0; j < g; j++) {
						e[j].style.width = d + "px"
					}
					var l = e[0].getElementsByTagName("img")[0];
					if(l) {
						var h = new Image();
						h.onload = function() {
							m.oBox.style.height = e[0].offsetHeight + "px";
							m.oUl.style.height = e[0].offsetHeight + "px";
							if(m.defaults.verticalCenter) {
								if(m.oBox.style.height.replace("px", "") >= document.documentElement.clientHeight) {
									m.oBox.parentNode.style.top = "50px";
									m.oBox.parentNode.style.marginTop = 0
								} else {
									m.oBox.parentNode.style.top = "50%";
									m.oBox.parentNode.style.marginTop = "-50%"
								}
							}
							for(var p = 0; p < e.length; p++) {
								e[p].style.height = e[0].offsetHeight + "px"
							}
						};
						h.src = l.src
					} else {
						this.oBox.style.height = e[0].offsetHeight + "px"
					}
				}
			} else {
				d = this.oBox.offsetWidth;
				if(d >= 640) {
					d = 640
				}
				c = (d / 320) * 225;
				k = (d / 320) * 150;
				for(var j = 0; j < g; j++) {
					e[j].style.width = c + "px";
					e[j].style.height = k + "px"
				}
				o.style.width = c * g + "px";
				this.oBox.style.height = k + "px";
				this.oUl.style.height = k + "px";
				e[0].style.padding = "0";
				n = c
			}
			if(this.defaults.loop) {
				for(var j = 0; j < g; j++) {
					b.setStyle(e[j], {
						position: "absolute",
						left: 0,
						top: 0
					});
					if(g >= 2) {
						m.loadImg(e[1])
					}
					if(j == b.getNow(f, g)) {
						m.loadImg(e[j]);
						b.setStyle(e[j], {
							WebkitTransform: "translate3d(" + 0 + "px, 0px, 0px)",
							transform: "translate3d(" + 0 + "px, 0px, 0px)",
							zIndex: 10
						})
					} else {
						if(j == b.getPre(f, g)) {
							b.setStyle(e[j], {
								WebkitTransform: "translate3d(" + -n + "px, 0px, 0px)",
								transform: "translate3d(" + -n + "px, 0px, 0px)",
								zIndex: 10
							})
						} else {
							if(j == b.getNext(f, g)) {
								b.setStyle(e[j], {
									WebkitTransform: "translate3d(" + n + "px, 0px, 0px)",
									transform: "translate3d(" + n + "px, 0px, 0px)",
									zIndex: 10
								})
							} else {
								if(j == b.getNextNew(f, g)) {
									b.setStyle(e[j], {
										WebkitTransform: "translate3d(" + n * 2 + "px, 0px, 0px)",
										transform: "translate3d(" + n * 2 + "px, 0px, 0px)",
										zIndex: 10
									})
								} else {
									b.setStyle(e[j], {
										WebkitTransform: "translate3d(" + -n + "px, 0px, 0px)",
										transform: "translate3d(" + -n + "px, 0px, 0px)",
										zIndex: 9
									})
								}
							}
						}
					}
				}
			} else {
				for(var j = 0; j < g; j++) {
					b.setStyle(e[j], {
						WebkitTransform: "translate3d(" + f * -n + "px, 0px, 0px)",
						transform: "translate3d(" + f * -n + "px, 0px, 0px)"
					})
				}
			}
		},
		handleEvent: function(d) {
			var c = b._device(),
				e = this.oBox;
			switch(d.type) {
				case c.startEvt:
					if(this.defaults.autoPlay) {
						this.pause()
					}
					this.startHandler(d);
					break;
				case c.moveEvt:
					if(this.defaults.autoPlay) {
						this.pause()
					}
					this.moveHandler(d);
					break;
				case c.endEvt:
					if(this.defaults.autoPlay) {
						this.pause();
						this.play()
					}
					this.endHandler(d);
					break;
				case "touchcancel":
					if(this.defaults.autoPlay) {
						this.pause();
						this.play()
					}
					this.endHandler(d);
					break;
				case "orientationchange":
					this.orientationchangeHandler();
					break;
				case "resize":
					this.orientationchangeHandler();
					break;
				case "focus":
					if(this.defaults.autoPlay) {
						this.pause();
						this.play()
					}
					break;
				case "blur":
					if(this.defaults.autoPlay) {
						this.pause()
					}
					break;
				case "focusin":
					if(this.defaults.autoPlay) {
						this.pause();
						this.play()
					}
					break;
				case "focusout":
					if(this.defaults.autoPlay) {
						this.pause()
					}
					break
			}
		},
		startHandler: function(e) {
			this.on0ff = true;
			var d = b._device(),
				f = d.hasTouch,
				h = this.oBox,
				c = this.now,
				g = this.aLi;
			h.addEventListener(d.moveEvt, this);
			h.addEventListener(d.endEvt, this);
			this.downTime = Date.now();
			this.downX = f ? e.targetTouches[0].pageX : e.clientX - h.offsetLeft;
			this.downY = f ? e.targetTouches[0].pageY : e.clientY - h.offsetTop;
			this.startT = b.getTranX(g[b.getNow(c, g.length)]);
			this.startNowT = b.getTranX(g[b.getNow(c, g.length)]);
			this.startPreT = b.getTranX(g[b.getPre(c, g.length)]);
			this.startNextT = b.getTranX(g[b.getNext(c, g.length)]);
			this.startNextN = b.getTranX(g[b.getNextNew(c, g.length)]);
			b.stopPropagation(e)
		},
		moveHandler: function(q) {
			var n = this.oBox,
				e = b._device();
			if(this.on0ff) {
				var o = e.hasTouch;
				var j = o ? q.targetTouches[0].pageX : q.clientX - n.offsetLeft;
				var h = o ? q.targetTouches[0].pageY : q.clientY - n.offsetTop;
				var c = this.aLi,
					g = c.length,
					d = this.now,
					t = c[0].offsetWidth;
				if(this.defaults.preDef == "all") {
					b.stopDefault(q)
				}
				for(var m = 0; m < g; m++) {
					b.setStyle(c[m], {
						WebkitTransition: "all 0ms ease",
						transition: "all 0ms ease"
					})
				}
				if(Math.abs(j - this.downX) < Math.abs(h - this.downY)) {
					if(this.defaults.preDef == "tnd" && this.defaults.preDef != "all") {
						b.stopDefault(q)
					}
				} else {
					if(Math.abs(j - this.downX) > 10) {
						if(this.defaults.preDef == "lnr" && this.defaults.preDef != "all") {
							b.stopDefault(q)
						}
						if(this.defaults.loop) {
							k = (this.startNowT + j - this.downX).toFixed(4);
							var s = (this.startPreT + j - this.downX).toFixed(4);
							var f = (this.startNextT + j - this.downX).toFixed(4);
							var l = (this.startNextN + j - this.downX).toFixed(4);
							b.move(c[b.getNow(d, g)], k, 10, this.defaults.fullScreen);
							b.move(c[b.getPre(d, g)], s, 10, this.defaults.fullScreen);
							b.move(c[b.getNext(d, g)], f, 10, this.defaults.fullScreen);
							b.move(c[b.getNextNew(d, g)], l, 10, this.defaults.fullScreen)
						} else {
							var k = b.getTranX(c[d]);
							if(k > 0) {
								var p = ((this.startT + j - this.downX) / 3).toFixed(4);
								for(var m = 0; m < g; m++) {
									b.move(c[m], p, 10, this.defaults.fullScreen)
								}
							} else {
								if(Math.abs(k) >= Math.abs((g - 1) * t)) {
									var p = (this.startT + (j - this.downX) / 3).toFixed(4);
									for(var m = 0; m < g; m++) {
										b.move(c[m], p, 10, this.defaults.fullScreen)
									}
									if(this.defaults.laseMoveFn && typeof this.defaults.laseMoveFn == "function") {
										var r = (p - this.startT).toFixed(4);
										this.defaults.laseMoveFn(r)
									}
								} else {
									var p = (this.startT + j - this.downX).toFixed(4);
									for(var m = 0; m < g; m++) {
										b.move(c[m], p, 10, this.defaults.fullScreen)
									}
								}
							}
						}
					}
				}
			} else {
				n.removeEventListener(e.moveEvt, this);
				n.removeEventListener(e.endEvt, this)
			}
			b.stopPropagation(q)
		},
		endHandler: function(i) {
			i.stopPropagation();
			this.on0ff = false;
			var f = Date.now(),
				e = b._device(),
				h = e.hasTouch,
				g = this.oBox,
				l = h ? i.changedTouches[0].pageX : i.clientX - g.offsetLeft,
				k = h ? i.changedTouches[0].pageY : i.clientY - g.offsetTop,
				c = this.aLi,
				j = c[0].offsetWidth,
				d = b.getTranX(c[b.getNow(this.now, c.length)]);
			if(l - this.downX < 30 && l - this.downX >= 0 && Math.abs(k - this.downY) < 30) {
				this.tab(d, "+=");
				return "click"
			} else {
				if(l - this.downX > -30 && l - this.downX <= 0 && Math.abs(k - this.downY) < 30) {
					this.tab(d, "-=");
					return "click"
				} else {
					if(Math.abs(k - this.downY) - Math.abs(l - this.downX) > 30 && l - this.downX < 0) {
						this.tab(d, "-=");
						return
					}
					if(Math.abs(k - this.downY) - Math.abs(l - this.downX) > 30 && l - this.downX > 0) {
						this.tab(d, "+=");
						return
					}
					if(l < this.downX) {
						if(this.downX - l > j / 3 || f - this.downTime < 200) {
							this.now++;
							this.tab(d, "++");
							return "left"
						} else {
							this.tab(d, "+=");
							return "stay"
						}
					} else {
						if(l - this.downX > j / 3 || f - this.downTime < 200) {
							this.now--;
							this.tab(d, "--");
							return "right"
						} else {
							this.tab(d, "-=");
							return "stay"
						}
					}
				}
			}
			b.stopPropagation(i);
			g.removeEventListener(e.moveEvt, this);
			g.removeEventListener(e.endEvt, this)
		},
		tab: function(e, l, f) {
			var c = this.aLi,
				k = c.length,
				r = c[0].offsetWidth,
				q = this.oBox,
				g = b._device(),
				p = this,
				d = this.now;
			if(this.defaults.callback && (l == "++" || l == "--")) {
				this.defaults.callback((b.getNow(d, k) + 1) % this.defaults.total == 0 ? this.defaults.total : (b.getNow(d, k) + 1) % this.defaults.total)
			}
			if(this.defaults.loop) {
				if(d < 0) {
					d = k - 1;
					this.now = k - 1
				}
				for(var o = 0; o < k; o++) {
					if(o == b.getPre(d, k)) {
						var h;
						switch(l) {
							case "++":
								h = 300;
								break;
							case "--":
								h = 0;
								break;
							case "+=":
								h = 0;
								break;
							case "-=":
								h = 300;
								break;
							default:
								break
						}
						b.setStyle(c[b.getPre(d, k)], {
							WebkitTransform: "translate3d(" + -r + "px, 0px, 0px)",
							transform: "translate3d(" + -r + "px, 0px, 0px)",
							zIndex: 10,
							WebkitTransition: "all " + h + "ms ease",
							transition: "all " + h + "ms ease"
						});
						if(!p.defaults.fullScreen) {
							b.setStyle(c[b.getPre(d, k)], {
								padding: "0.8%"
							})
						}
					} else {
						if(o == b.getNow(d, k)) {
							b.setStyle(c[b.getNow(d, k)], {
								WebkitTransform: "translate3d(" + 0 + "px, 0px, 0px)",
								transform: "translate3d(" + 0 + "px, 0px, 0px)",
								zIndex: 10,
								WebkitTransition: "all " + 300 + "ms ease",
								transition: "all " + 300 + "ms ease"
							});
							if(!p.defaults.fullScreen) {
								b.setStyle(c[b.getNow(d, k)], {
									padding: "0"
								})
							}
						} else {
							if(o == b.getNext(d, k)) {
								var h = 300;
								switch(l) {
									case "++":
										h = 0;
										break;
									case "--":
										h = 300;
										break;
									case "+=":
										h = 300;
										break;
									case "-=":
										h = 0;
										break;
									default:
										break
								}
								b.setStyle(c[b.getNext(d, k)], {
									WebkitTransform: "translate3d(" + r + "px, 0px, 0px)",
									transform: "translate3d(" + r + "px, 0px, 0px)",
									zIndex: 10,
									WebkitTransition: "all " + h + "ms ease",
									transition: "all " + h + "ms ease"
								});
								if(!p.defaults.fullScreen) {
									b.setStyle(c[b.getNext(d, k)], {
										padding: "0.8%"
									})
								}
							} else {
								if(o == b.getNextNew(d, k)) {
									var h;
									switch(l) {
										case "++":
											h = 0;
											break;
										case "--":
											h = 300;
											break;
										case "+=":
											h = 300;
											break;
										case "-=":
											h = 0;
											break;
										default:
											break
									}
									b.setStyle(c[b.getNextNew(d, k)], {
										WebkitTransform: "translate3d(" + r * 2 + "px, 0px, 0px)",
										transform: "translate3d(" + r * 2 + "px, 0px, 0px)",
										zIndex: 10,
										WebkitTransition: "all " + h + "ms ease",
										transition: "all " + h + "ms ease"
									});
									if(!p.defaults.fullScreen) {
										b.setStyle(c[b.getNextNew(d, k)], {
											padding: "0.8%"
										})
									}
								} else {
									b.setStyle(c[o], {
										WebkitTransform: "translate3d(" + r * 2 + "px, 0px, 0px)",
										transform: "translate3d(" + r * 2 + "px, 0px, 0px)",
										zIndex: 9,
										WebkitTransition: "all " + 0 + "ms ease",
										transition: "all " + 0 + "ms ease"
									})
								}
							}
						}
					}
				}
			} else {
				for(var o = 0; o < k; o++) {
					b.setStyle(c[o], {
						WebkitTransition: "all " + 300 + "ms ease",
						transition: "all " + 300 + "ms ease"
					})
				}
				if(d <= 0) {
					d = 0;
					this.now = 0
				}
				if(d > k - 1) {
					if(f) {
						d = 0;
						this.now = 0
					} else {
						d = k - 1;
						this.now = k - 1
					}
				}
				for(var n = 0; n < k; n++) {
					b.setStyle(c[n], {
						WebkitTransform: "translate3d(" + (-d * r) + "px, 0px, 0px)",
						transform: "translate3d(" + (-d * r) + "px, 0px, 0px)"
					})
				}
			}
			$(c[b.getNow(d, k)]).addClass("active").siblings().removeClass("active");
			p.loadImg(c[b.getNow(d, k)]);
			p.loadImg(c[b.getNow(d + 1, k)]);
			if(this.defaults.smallBtn) {
				for(var o = 0; o < this.btns.length; o++) {
					this.btns[o].className = ""
				}
				if(this.need) {
					this.btns[b.getNow(d, k / 2)].className = "active"
				} else {
					this.btns[b.getNow(d, k)].className = "active"
				}
			}
			if(this.defaults.number) {
				this.slideNub.innerHTML = ((b.getNow(d, k) + 1) % this.defaults.total == 0 ? this.defaults.total : (b.getNow(d, k) + 1) % this.defaults.total)
			}
			c[b.getNow(d, k)].addEventListener("webkitTransitionEnd", m, false);
			c[b.getNow(d, k)].addEventListener("transitionend", m, false);

			function m() {
				if(p.defaults.location) {
					if(e < -(k - 1) * r - r / 5) {
						if(p.defaults.lastImgSlider && typeof p.defaults.lastImgSlider == "function") {
							p.defaults.laseMoveFn(0);
							p.defaults.lastImgSlider()
						}
					}
				}
				c[b.getNow(p.now, k)].removeEventListener("webkitTransitionEnd", m, false);
				c[b.getNow(p.now, k)].removeEventListener("transitionend", m, false)
			}
		},
		play: function() {
			var c = this;
			c.timer = setInterval(function() {
				c.now++;
				c.tab(null, "++", true)
			}, this.defaults.playTime)
		},
		pause: function() {
			var c = this;
			clearInterval(c.timer)
		},
		orientationchangeHandler: function() {
			var c = this;
			setTimeout(function() {
				c.liInit()
			}, 300)
		},
		addSmallBtn: function() {
			var d = "",
				e = this.aLi;
			for(var c = 0; c < e.length; c++) {
				if(c == this.defaults.startIndex) {
					d += '<span class="active" data-ol-btn="btn"></span>'
				} else {
					d += '<span data-ol-btn="btn"></span>'
				}
			}
			return d
		},
		checkIphone: function() {
			var c = window.navigator.userAgent.toLowerCase();
			if(/iphone|ipd|ipod/.test(c)) {
				return true
			} else {
				return false
			}
		},
		setImgURL: function(e) {
			var j = this;
			var g = e[0].getAttribute("" + j.imgSrc + "");
			var d = e[0].getAttribute("src");
			var h = "";
			if(!!!g || d == "") {
				var i = e[0].outerHTML;
				console.log("Opps!Something Wrong!Please notice it!--:" + i)
			} else {
				h = g.replace(/http:/g, "")
			}
			var c = parseInt(e.width()) * 2;
			var f = parseInt(e.height()) * 2;
			if(c < 2 || f < 2 || !h) {
				return h
			}
			h = h.replace(/(s[0-9]{0,4}x[0-9]{0,4}_)?jfs/, "s" + c + "x" + f + "_jfs");
			if(!!h && h.indexOf(".webp") == -1 && !j.checkIphone()) {
				h = h + ".webp"
			}
			return h
		},
		changSrc: function(c) {
			var g = $("#scwrapper").css("display");
			if(g != "none") {
				var h = this;
				var f = c.attr("" + h.imgSrc + "");
				var e = new Image();
				var d = f;
				if(!!h.isOpen) {
					if(f) {
						d = h.setImgURL(c)
					}
				}
				c.css("opacity", 0);
				e.src = d;
				e.onload = function() {
					c.attr("src", d).removeAttr("" + h.imgSrc + "").css("opacity", 1)
				};
				e.onerror = function() {
					c.attr("src", f).removeAttr("" + h.imgSrc + "").css("opacity", 1)
				}
			}
		},
		loadImg: function(e) {
			var f = this;
			var c = $(e).find("img");
			var d = $(e).find("img").attr("" + f.imgSrc + "");
			if(d) {
				f.changSrc(c)
			}
		},
		show: function() {
			this.oBox.style.display = "inline-block"
		},
		hide: function() {
			this.oBox.style.display = "none"
		}
	};
	b.extend = function(d, c) {
		for(name in c) {
			if(c[name] !== undefined) {
				d[name] = c[name]
			}
		}
	};
	b.extend(b, {
		setStyle: function(d, c) {
			for(name in c) {
				d.style[name] = c[name]
			}
		},
		getTranX: function(e) {
			var d = e.style.WebkitTransform || e.style.transform;
			var f = d.indexOf("translate3d(");
			var c = parseInt(d.substring(f + 12, d.length - 13));
			return c
		},
		_device: function() {
			var f = !!("ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch);
			var d = "touchstart";
			var e = "touchmove";
			var c = "touchend";
			return {
				hasTouch: f,
				startEvt: d,
				moveEvt: e,
				endEvt: c
			}
		},
		getNow: function(d, c) {
			return d % c
		},
		getPre: function(e, c) {
			if(e % c - 1 < 0) {
				var d = c - 1
			} else {
				var d = e % c - 1
			}
			return d
		},
		getNext: function(e, d) {
			var c = (e + 1) % d;
			return c
		},
		getNextNew: function(e, d) {
			var c = (e + 2) % d;
			return c
		},
		move: function(g, d, f, c) {
			var h = f || null;
			if(h) {
				g.style.zIndex = h
			}
			b.setStyle(g, {
				WebkitTransform: "translate3d(" + d + "px, 0px, 0px)",
				transform: "translate3d(" + d + "px, 0px, 0px)"
			});
			if(!c) {
				var e = parseFloat(d) / 100;
				if(e > 0.8) {
					e = 0.8
				} else {
					if(-0.8 < e < 0) {
						e = (-e)
					} else {
						if(e <= -0.8) {
							e = 0.8
						}
					}
				}
				b.setStyle(g, {
					padding: e + "%"
				})
			}
		},
		stopDefault: function(c) {
			if(c && c.preventDefault) {
				c.preventDefault()
			} else {
				window.event.returnValue = false
			}
			return false
		},
		stopPropagation: function(c) {
			if(c && c.stopPropagation) {
				c.stopPropagation()
			} else {
				c.cancelBubble = true
			}
		}
	});
	return a
})();
M.define("downloadpannel", function(b) {
	var a = function(c) {
		this.init(c)
	};
	M.object.merge(a.prototype, {
		init: function(d) {
			var c = M.object.merge(d, {
				url: ""
			});
			this.url = c.url;
			this.source = c.source;
			this.cookieFlag = !!c.cookieFlag ? c.cookieFlag : "m_index";
			this.sourceType = !!c.sourceType ? c.sourceType : "M";
			this.sourceValue = !!c.sourceValue ? c.sourceValue : "index"
		},
		setMping: function(d) {
			try {
				var f = new MPing.inputs.Click(d);
				f.event_param = "";
				var c = new MPing();
				c.send(f)
			} catch(g) {
				source.log("dowloadbanner mping virtual errpr", g)
			}
		},
		appShieldBind: function(f) {
			var c = this;
			var l = M.object.merge({
				closecallback: null,
				openappback: null,
				sourceform: "",
				maskEvent: "MHome_MaskPic"
			}, f.action);
			var c = this;
			var k = l.beforedom;
			var j = l.afterdom;
			var g = (!!f.containerdom || !M.object.isString(f.containerdom)) ? document.body : (document.getElementById(f.containerdom) == null ? document.body : document.getElementById(f.containerdom));
			if(!!!l.openappback) {
				l.openappback = function() {
					document.querySelector("#" + m).style.display = "none"
				}
			}
			var m = l.bannerid;
			var h = l.openappid;
			var i = l.closebtnid;
			var e = document.createElement("div");
			e.id = m;
			e.className = "app-download-popup";
			e.style = "display: block;transform-origin: 0px 0px 0px;opacity: 1;transform: scale(1, 1);";
			e.innerHTML = '<div class="app-download-popup-inner"><i id="' + i + '"  class="btn-close"></i><div  id="' + h + '" ><img id="maskpic"   src="' + c.url + '/images/index/app.png"><span class="app-btn"><img id="maskgo"   src="' + c.url + '/images/index/app-go.png"></span></div></div>';
			g.insertAdjacentElement("beforeEnd", e);
			document.getElementById("maskpic").addEventListener("click", function() {
				!!l.oldmaskEvent && c.setMping(l.oldmaskEvent);
				c.setMping(l.maskEvent)
			});
			document.getElementById("maskgo").addEventListener("click", function() {
				!!l.oldopenEvent && c.setMping(l.oldopenEvent);
				c.setMping(l.openEvent)
			});
			document.getElementById(i).addEventListener("click", function() {
				!!l.oldcloseEvent && c.setMping(l.oldcloseEvent)
			});
			var d = {
				openAppBtnId: h,
				closePanelBtnId: i,
				closePanelId: m,
				downAppURl: l.downAppURl,
				closeCallblack: l.closecallback,
				closeCallblackSource: c.source,
				openAppCallback: l.openappback,
				openAppCallblackSource: c.source,
				cookieFlag: !!l.cookieFlag ? l.cookieFlag : c.cookieFlag,
				openAppEventId: null,
				closePanelEventId: l.closeEvent,
				sourceType: c.sourceType,
				sourceValue: c.sourceValue,
				appDownCloseIntervalTime: l.appDownCloseIntervalTime,
				appDownOpenIntervalTime: l.appDownOpenIntervalTime,
				M_sourceFrom: l.sourceform
			};
			$.downloadAppPlugIn(d)
		},
		appBannerBind: function(j) {
			var c = this;
			var f = M.object.merge({
				content1: "免费领取188元大礼包",
				content2: "首次下单前即可领取",
				fontSizeOne: "13px",
				fontSizeTwo: "13px",
				colorOne: "#FFFFFF",
				colorTwo: "#999999",
				iconColor: "#FFFFFF",
				logo: (c.url + "/images/index/top-jdlogo.png"),
				icon: "立即领取"
			}, j.data);
			var p = M.object.merge({
				closecallback: function() {},
				openappcallback: function() {},
				sourceform: ""
			}, j.action);
			var c = this;
			var n = p.beforedom;
			var m = p.afterdom;
			if(!M.object.isString(n) && !M.object.isString(n)) {
				c.log(">> banner cannot be setted into dom tree!")
			}
			if(!!!p.openappback && !!p.oldopenEvent) {
				p.openappback = function() {
					c.setMping(p.oldopenEvent)
				}
			}
			var q = p.bannerid;
			var k = p.openappid;
			var l = p.closebtnid;
			var i = document.createElement("div");
			i.id = q;
			var d = !!f.bg;
			i.className = "download-pannel" + (!d ? " download-noBg" : "");
			var h = f && f.fontSizeOne && f.colorOne ? "font-size:" + f.fontSizeOne + ";color:" + f.colorOne + ";" : "";
			var r = f && f.fontSizeTwo && f.colorTwo ? "font-size:" + f.fontSizeTwo + ";color:" + f.colorTwo + ";" : "";
			var o = f && f.iconColor ? "color:" + f.iconColor + ";" : "";
			var g = [];
			if(d) {
				g.push('<div class="pannel-bg"><img src="' + f.bg + '"></div>')
			}
			g.push('<div class="download-close"><img  id="' + l + '"   src="' + c.url + '/images/index/icon-close-banner.png"></div>');
			g.push('<div class="download-logo"><img src="' + f.logo + '"></div>');
			g.push('<div class="download-txt"><span class="download-content"><em class="content-up" style="' + h + '">' + f.content1 + '</em><em class="content-down"style="' + r + '">' + f.content2 + "</em></span></div>");
			g.push('<div class="download-action"><a id="' + k + '" href="javascript:;"><span ' + (f.icon.length <= 4 ? 'class="font-large"' : "") + 'style="' + o + '">' + f.icon + "</span></a></div>");
			i.innerHTML = g.join("");
			if(n != null) {
				$("#" + n).before(i)
			} else {
				if(m != null) {
					$("#" + m).after(i)
				}
			}
			var e = {
				openAppBtnId: k,
				closePanelBtnId: l,
				closePanelId: q,
				downAppURl: p.downAppURl,
				openAppCallback: p.openappback,
				closeCallblack: p.closecallback,
				closeCallblackSource: c.source,
				cookieFlag: !!p.cookieFlag ? p.cookieFlag : c.cookieFlag,
				openAppEventId: p.openEvent,
				closePanelEventId: p.closeEvent,
				sourceType: c.sourceType,
				sourceValue: c.sourceValue,
				appDownCloseIntervalTime: p.appDownCloseIntervalTime,
				appDownOpenIntervalTime: p.appDownOpenIntervalTime,
				M_sourceFrom: p.sourceform
			};
			$.downloadAppPlugIn(e)
		},
		autoOpenapp: function(d) {
			var c = {
				M_sourceFrom: "index",
				NoJumpDownLoadPage: true,
				kepler_param: null,
				cookieFlag: "index_auto"
			};
			$.downloadAppPlugInOpenApp(c)
		},
		showLayer: function() {
			var c = {
				M_sourceFrom: "index",
				pcScan_Layer: true,
				pcScan_Layer_param: {
					msf_type: "pcmask"
				},
				newPeople_Layer: true,
				newPeople_Layer_param: {
					msf_type: "xrmask"
				}
			};
			$.downloadAppShowLayer(c)
		},
		downloadAppPlugInOpenApp: function(e) {
			var d = this;
			var c = {
				openAppBtnId: e.openapp,
				closePanelBtnId: e.closerbtn,
				closePanelId: e.bannerid,
				downAppURl: e.downAppURl,
				openAppCallback: e.openappback,
				openAppCallblackSource: d.source,
				closeCallblack: e.closecallback,
				closeCallblackSource: d.source,
				inteneUrl: e.inteneUrl,
				inteneUrlParams: e.inteneUrlParams,
				cookieFlag: e.cookieFlag,
				noRecord: !!e.noRecord,
				openAppEventId: e.openEvent,
				closePanelEventId: e.closeEvent,
				sourceType: d.sourceType,
				sourceValue: d.sourceValue,
				appDownCloseIntervalTime: e.appDownCloseIntervalTime,
				appDownOpenIntervalTime: e.appDownOpenIntervalTime,
				M_sourceFrom: e.sourceform
			};
			$.downloadAppPlugIn(c)
		},
		log: function(c, d) {
			console.log("Opps!Something Wrong!Please notice it!--" + c + ",error:" + d)
		}
	});
	b.clazz = a
});
M.define("index", function(a) {
	var b = function(c) {
		this.init(c)
	};
	M.object.merge(b.prototype, {
		init: function(d) {
			this.threadTime = 500;
			this.thread = new(M.exports("thread").clazz)({
				time: this.threadTime
			});
			if(M.object.isObject(d)) {
				this.lastseckillTime = null;
				this.beenshield = false;
				this.recommendhasrender = false;
				this.appBannerID = "download_banner";
				this.openapp = "download_openapp";
				this.openweb = "download_openweb";
				this.slider = [];
				this.jsswitch = this.getargval(d.jsswitch, {});
				this.url = this.getargval(d.url, "");
				this.autoseckill = this.getswitch("autoSeckill");
				this.newseckillurl = this.getargval(d.index_newseckill, "//ms.m.jd.com/seckill/seckillList");
				this.bannerobj = (!!d.appBanner && !M.object.isEmpty(d.appBanner.banner)) ? d.appBanner.banner : null;
				this.hasAppBanner = d && d.appBanner ? d.appBanner.isOpen : false;
				this.appBannerType = d && d.appBanner ? d.appBanner.indexClientType : 0;
				this.openbannertime = this.getswitchvalue("openbannertime");
				this.closebannertime = this.getswitchvalue("closebannertime");
				this.openReportTime = this.getargval(d.reporttime);
				this.ishttpinvoke = this.getargval(d.ishttpinvoke);
				this.rotatetime = this.getargval(d.rotatetime);
				this.ismeritco = this.getargval(d.ismeritco, false);
				this.noindexOptimizeImg = this.getswitch("indexOptimizeImg");
				this.noscreenlog = this.getswitch("indexScreenlog");
				this.nocartnum = this.getswitch("indexShowCartnum");
				this.meritcopin = this.getargval(d.meritpin, "");
				this.indexshield = this.getswitch("appShield");
				this.indexShowSearch = this.getswitch("indexShowSearch");
				this.$ = $(window);
				this.autoappcall = this.getswitch("autoappcall");
				this.globalabtest = this.getswitchvalue("globalabtest");
				this.sliderInit(d);
				this.seckillInit(d);
				this.floatLayerInit(d.indexFloatLayer);
				this.topLayerInit(d.indexPhotoCeiling);
				this.topLayerHt = 0;
				this.recommendInit(this.getswitchvalue("recommend"));
				this.indexBfloor = this.getswitch("indexBfloor");
				this.botRecommend = this.getswitch("indexbotRecommend");
				this.indexSlide = this.getswitch("indexSlide");
				this.recommendExpiresTime = this.getswitchvalue("recommendExpiresTime");
				this.recommendShowTime = this.getswitchvalue("recommendShowTime");
				this.stopTouchTime = this.getswitchvalue("stopTouchTime");
				this.recommendAnimationTime = 400;
				this.stopTime = 0;
				this.bSlide = false
			}
			var c = "";
			var c = d.searchland.searchBoxWord;
			this.searchLand = new(M.exports("searchland").clazz)({
				showFuncObj: {
					source: this,
					func: function() {
						this.indexBodyheight = $("body").height();
						$("body").css("height", "auto");
						var f = $("#" + this.appBannerID + "");
						if(f && f.height() > 0) {
							var g = $("#fixedtop");
							var j = $("#topheader");
							var e = g.children("div");
							for(var h = 0; h < e.length; h++) {
								if(!$(e[h]).attr("search_land_searchTransformation_show")) {
									$(e[h]).css("display", "none")
								}
							}
							j.css("display", "none")
						}
					}
				},
				hideFuncObj: {
					source: this,
					func: function() {
						$("#index_clear_keyword").hide();
						$("body").css("height", this.indexBodyheight);
						var f = $("#" + this.appBannerID + "");
						var g = $("#fixedtop");
						g.css("display", "none");
						var e = g.children("div");
						for(var h = 0; h < e.length; h++) {
							if(!$(e[h]).attr("search_land_searchTransformation_show")) {
								$(e[h]).css("display", "block")
							}
						}
						setTimeout(function() {
							var i = {
								display: "block"
							};
							g.css(i);
							if(g[0].className.indexOf("showfixedtop-half") < 0 && f.height() > 0) {
								var j = $("#topheader");
								j.css("display", "block")
							}
						}, 200);
						window.scrollTo(0, this.indexloc)
					}
				},
				claerKeywordBtnId: "index_clear_keyword",
				searchPanelId: "index_search_head",
				keyword: c,
				renderId: $(document.body),
				landSearchWordHide: true,
				hotKeyword: d.searchland.hotKeyword ? d.searchland.hotKeyword : null,
				submitId: "index_search_submit",
				formId: "index_searchForm",
				catelogyListId: "index_category",
				keywordId: "index_newkeyword",
				isHome: true,
				closeSearchLandBtnId: "index_search_bar_cancel"
			});
			this.imgLazyLad = new(M.exports("Imglazyload").clazz)({
				isOpen: !this.noindexOptimizeImg
			});
			this.topId = "bar-top";
			this.recommendId = "bar-recommend";
			this.recommendTopH = 0
		},
		getswitch: function(c) {
			return !!!c ? false : !!this.jsswitch[c]
		},
		getswitchvalue: function(c) {
			return !!!c ? false : this.jsswitch[c]
		},
		getargval: function(e, c) {
			var d = typeof(c) == "undefined" ? null : c;
			return !!e ? e : d
		},
		abtest: function(d) {
			var c = this;
			var e = !!d ? d : 1;
			return !!c.globalabtest ? c.globalabtest : e
		},
		isA: function() {
			var c = this;
			return c.abtest() == 1
		},
		isB: function() {
			var c = this;
			return c.abtest() == 2
		},
		sendAB: function(c) {
			var d = this;
			setTimeout(function() {
				d.sendMping(c, d.isA() ? "A" : "B")
			}, 100)
		},
		isNull: function(c) {
			return !!c ? c : null
		},
		random: function(c, d) {
			if(!!!d) {
				d = 0
			}
			return Math.floor(d + Math.random() * (c - d))
		},
		sliderInit: function(g) {
			var c = this;
			if(g.sliderImgList && M.object.isArray(g.sliderImgList)) {
				c.sliderImgList = g.sliderImgList
			} else {
				c.sliderImgList = []
			}
			if(g.hybridslider && M.object.isArray(g.hybridslider)) {
				c.hybridslider = g.hybridslider;
				c._lazyslider = {
					list: [],
					count: 0
				};
				for(var d = 0, e = c.hybridslider.length; d < e; d++) {
					var k = c.hybridslider[d];
					var l = k.floorid;
					var h = k.no;
					c._lazyslider.list.push({
						id: "#slider_" + l + "_" + h + "_touch",
						created: false
					})
				}
			} else {
				c.hybridslider = []
			}
			c._sliderImgList = {};
			c._hybridslider = {};
			for(var f = 0, m = c.sliderImgList.length; f < m; f++) {
				var n = c.sliderImgList[f];
				c._sliderImgList[f] = n
			}
			for(var f = 0, m = c.hybridslider.length; f < m; f++) {
				var n = c.hybridslider[f];
				c._hybridslider[n.floorid] = n
			}
		},
		sliderHTML: function() {
			var f = [];
			var k = this;
			for(var d = 1; d < k.sliderImgList.length; d++) {
				var c = k.sliderImgList[d];
				f.push('<li  data-ul-child="child"  class="slide-li"><a class="J_ping"  report-eventlevel="1" report-eventid="MHome_BFocusPic" report-eventparam="' + c.sourceValue + '" page_name="index" href="' + c.action + '" ><img   _src="' + c.horizontalImag.replace(/http:/g, "") + '"  /></a></li>')
			}
			f = f.join("");
			var j = $("#slider_touch");
			j.append(f);
			var g = j.children("li").first().height() + "px";
			j.css({
				"min-height": g
			});
			if(k.sliderImgList && k.sliderImgList.length > 1) {
				k.hasActivityImg = true;
				var h = slide("#slider");
				try {
					h.init({
						loop: true,
						smallBtn: true,
						autoPlay: true,
						autoHeight: true,
						playTime: 3000,
						callback: function(e) {
							(function i(o, n) {
								if(!!o.searchLand.openSearchLoad) {
									return
								}
								n--;
								if(!!!o.ishttpinvoke) {
									return
								}
								if(o._sliderImgList == null || o._sliderImgList[n] == null) {
									return
								}
								var m = o._sliderImgList[n];
								if(!o.inviewport("#slider")) {
									return
								}
								if(m == null || m.exposalUrl == null || m.exposalUrl == "" || !!m.hasexposal) {
									return
								}
								m.hasexposal = true;
								o.imgHttp(m.exposalUrl)
							})(k, e)
						}
					})
				} catch(l) {
					$("#slider_touch").css("overflow", "hidden");
					k.log("slider error!", l)
				}
				k.slider.push(h)
			}
		},
		seckillInit: function(k, d) {
			var c = this;
			if(k.seckill) {
				var o = (d && (c.seclayout.gapwidth > 0)) ? (' style = "width:' + c.seclayout.gapwidth + 'px"') : "";
				if(!!!d) {
					c.seclayout = {
						urlobj: $("#seckillul"),
						liobj: null,
						urlwidth: 0,
						gapwidth: 0,
						more: 50
					}
				}
				if(k.seckill.seckillTime && k.seckill.timeRemain) {
					c.endTime = k.seckill.seckillTime;
					c.timeRemain = k.seckill.timeRemain;
					var g = k.seckillImgList;
					c.seclayout.seclist = g;
					c.seclayout.container = c.seclayout.urlobj.parent();
					var e = [];
					var h = "";
					if(g != null) {
						for(var j = d ? 0 : 3, m = g.length; j < m; j++) {
							var l = g[j];
							var f = l.wareId ? ("?wareId=" + l.wareId) : "";
							e.push('<li class="seckill-new-item" ' + o + '><div class="seckill-item-img bdr-r"><a report-eventid="MHome_BHandSeckill" report-eventlevel="1"  report-eventparam="' + l.sourceValue + '" page_name="index" href="' + c.newseckillurl + f + '" class="seckill-new-link J_ping"><img width="100%"  ' + (d ? ('src="' + l.imageurl.replace(/http:/g, "") + '"') : (' src="' + c.url + '/images/index/seckill-220-new.png" imgsrc="' + l.imageurl.replace(/http:/g, "") + '" ')) + ' border="0" class="seckill-photo" />');
							if(!!l.tagText) {
								e.push('<div class="seckill-tip" style="background-color:' + l.colorRGB + '">' + l.tagText + "</div>")
							}
							e.push('</a></div><div class="seckill-item-price"><span class="seckill-new-price"><em>&yen;</em>' + l.miaoShaPrice + '</span><span class="seckill-original-price"><em>&yen;</em>' + l.jdPrice + "<hr></span></div></li>")
						}
						if(g.length > 3) {
							e.push('<li class="seckill-all-item"><a href="' + c.newseckillurl + '"><div class="seckill-all"><i class="show-all-icon"></i><span class="show-all-title">查看全部</span></div></a></li>');
							if(d) {
								c.seclayout.urlobj.html(e.join(""))
							} else {
								c.seclayout.urlobj.append(e.join(""))
							}
						}
					}
					c.seckillTime = 1000;
					var n = $("#seckill_time").find("span");
					c.timezone = [n.eq(0), n.eq(1), n.eq(2), n.eq(3), n.eq(4), n.eq(5), n.eq(6), n.eq(7)];
					c.seckillTimer()
				}
			}
		},
		seckillTimer: function() {
			var c = this;
			var d = M.localstorage.get("index_seckill");
			var n = 0;
			if(d) {
				d = d.split("_");
				var k = d[0];
				var r = parseInt(d[1], 10);
				var q = M.date.toDate(d[2]);
				var s = parseInt(d[3], 10);
				if(c.endTime == k && c.timeRemain == r) {
					var e = new Date();
					var j = parseInt((e.getTime() - q.getTime()) / 1000, 10);
					n = s - j;
					M.localstorage.set("index_seckill", c.endTime + "_" + c.timeRemain + "_" + M.date.toString(e, "yyyy-MM-dd HH:mm:ss") + "_" + n)
				} else {
					var e = new Date();
					n = c.timeRemain;
					M.localstorage.set("index_seckill", c.endTime + "_" + c.timeRemain + "_" + M.date.toString(e, "yyyy-MM-dd HH:mm:ss") + "_" + n)
				}
			} else {
				var e = new Date();
				n = c.timeRemain = c.timeRemain - 1;
				M.localstorage.set("index_seckill", c.endTime + "_" + c.timeRemain + "_" + M.date.toString(e, "yyyy-MM-dd HH:mm:ss") + "_" + n)
			}
			var o = c.timezone;
			if(n > 0) {
				var t = n % 60;
				var g = parseInt(n / 60, 10);
				var i = g % 60;
				var h = parseInt(g / 60, 10);
				if(h <= 0) {
					o[0].text("0");
					o[1].text("0")
				} else {
					if(h > 99) {
						o[0].text("9");
						o[1].text("9")
					} else {
						if(h > 9 && h < 99) {
							var h = h + "";
							o[0].text(h[0]);
							o[1].text(h[1])
						} else {
							var h = h + "";
							o[0].text("0");
							o[1].text(h[0])
						}
					}
				}
				if(i <= 0) {
					o[3].text("0");
					o[4].text("0")
				} else {
					if(i > 9) {
						i = i + "";
						o[3].text(i[0]);
						o[4].text(i[1])
					} else {
						o[3].text(0);
						o[4].text(i)
					}
				}
				if(t <= 0) {
					o[6].text("0");
					o[7].text("0")
				} else {
					if(t > 9) {
						t = t + "";
						o[6].text(t[0]);
						o[7].text(t[1])
					} else {
						o[6].text(0);
						o[7].text(t)
					}
				}
			} else {
				o[0].text("0");
				o[1].text("0");
				o[3].text("0");
				o[4].text("0");
				o[6].text("0");
				o[7].text("0");
				c.seckillpause = true;
				var f = document.getElementById("seckill_loading");
				var p = function(m) {
					if(m && m.preventDefault) {
						m.preventDefault();
						m.stopPropagation()
					} else {
						if(window.event) {
							window.event.returnValue = false
						}
					}
					M.http.ajax({
						url: "/index/nextseckill.json?r=" + new Date().getTime(),
						type: "get",
						success: function(v) {
							if(v && v.seckill) {
								try {
									var x = null;
									x = JSON.parse(v.seckill);
									data = x.content;
									var u = {
										seckill: {}
									};
									if(data && data.indexMiaoSha.length > 0) {
										u.seckill = {
											seckillTime: data.overDate,
											timeRemain: data.timeRemain
										};
										u.seckillImgList = data.indexMiaoSha
									}
									var w = [];
									w.push('<a class="seckill-left-link   J_ping " href="' + c.newseckillurl + '" page_name="index" report-eventlevel="1" report-eventparam="" report-eventid="MHome_BHandSeckillTopic">');
									if(!!x.showNameImg) {
										w.push('<img id="seckill_name"  class="seckill-tit-img" src="' + data.showNameImg.replace("http:", "") + '"/>')
									} else {
										w.push('<h2 id="seckill_name"  class="seckill-title">' + data.showName + "</h2>")
									}
									w.push('<strong  id="seckill_now"  class="seckill-nth" style="font-color:' + data.maintitleColor + '">' + data.name + "</strong>");
									w.push(' <div  id="seckill_time" class="seckill-timer" id="seckill_time"><div class="seckill-time"><span>0</span><span>0</span></div><span class="seckill-time-separator">:</span><div class="seckill-time"><span>0</span><span>0</span></div><span class="seckill-time-separator">:</span><div class="seckill-time"><span>0</span><span>0</span></div></div><span id="seckill_loading"></span>');
									w.push("</a>");
									w.push('<a class="seckill-more-link  J_ping" href="' + c.newseckillurl + '" page_name="index" report-eventlevel="1" report-eventparam="' + x.rcSourceValue + '" report-eventid="MHome_BHandSeckillMore">');
									w.push(!!x.rightCorner ? x.rightCorner : "更多秒杀");
									w.push('<i class="seckill-more-icon"></i></a>');
									$("#seckill_title").html(w.join(""));
									c.seckillInit(u, true);
									c.seckillpause = false;
									if(c.seclayout) {
										seckillimg = c.seclayout.urlobj.find("img");
										c.resizeSeckZone();
										var z = seckillimg.length;
										seckillimg.each(function() {
											var A = this;
											A.onload = function() {
												z--;
												if(z % 5 == 0) {
													c.resizeSeckimg(seckillimg)
												}
											}
										})
									}
								} catch(y) {
									c.log("nextseckill error!", y);
									data = null
								}
								f.className = "";
								$("#seckill_time")[0].className = "seckill-timer"
							}
						},
						error: function(u) {
							f.className = "";
							$("#seckill_time")[0].className = "seckill-timer"
						}
					});
					return false
				};
				if(c.lastseckillTime != null && ((new Date()).getTime()) - c.lastseckillTime.getTime() < 3600000) {
					return
				}
				if(c.autoseckill) {
					c.lastseckillTime = new Date();
					f.className = "seckill-loading";
					f.onclick = null;
					var l = c.random(5) + Math.random();
					setTimeout(p, l * 1000)
				} else {
					f.className = "seckill-nextsec";
					var l = 0;
					f.onclick = p
				}
			}
		},
		seckillRun: function(d) {
			var c = this;
			c.seckillTime = c.seckillTime - d;
			if(c.seckillTime == 0) {
				c.seckillTime = 1000;
				if(c.seckillpause) {
					return
				}
				c.seckillTimer()
			}
		},
		seckillRender: function() {
			var c = this;
			c.thread.addOne({
				name: "seckill",
				event: c.seckillRun,
				source: c
			})
		},
		appcenterHandler: function() {
			var c = this;
			var j = $("#appcenter a[sensitive]");
			if(j.length > 0) {
				for(var k = 0, o = j.length; k < o; k++) {
					var s = j[k];
					s.id = M.genId("sensitive_");
					var n = s.getAttribute("report-eventid");
					var r = s.getAttribute("report-eventparam");
					var h = s.getAttribute("report-eventlevel");
					var q = s.getAttribute("href");
					var l = s.getAttribute("channel");
					if(s.getAttribute("openapp") == 1) {
						var p = s.getAttribute("inteneUrl");
						var d = s.getAttribute("inteneParams");
						var g = s.getAttribute("sourceform");
						try {
							var f = {
								openapp: s.id,
								openappback: function() {
									c.sendMping(n, r, h)
								},
								inteneUrl: p,
								inteneUrlParams: JSON.parse(d),
								noRecord: true,
								source: c,
								downAppURl: "https://h5.m.jd.com/active/download/download.html?channel=" + l,
								sourceform: g
							};
							c.pannel.downloadAppPlugInOpenApp(f)
						} catch(m) {
							c.log("appcenter downloadAppPlugin!", m)
						}
					}
				}
			}
		},
		sendMping: function(f, d, h) {
			try {
				var g = new MPing.inputs.Click(f);
				g.event_param = !!d ? d : "";
				g.event_level = !!h ? parseInt(h) : "";
				var c = new MPing();
				c.send(g)
			} catch(i) {
				source.log("mping sendMping errpr", i)
			}
		},
		appBannerBind: function() {
			var c = this;
			var g = new(M.exports("downloadpannel").clazz)({
				url: c.url,
				source: c
			});
			c.pannel = g;
			if(c.autoappcall) {
				g.autoOpenapp()
			}
			if(c.indexshield) {
				g.showLayer()
			}
			var n = !!c.bannerobj ? c.bannerobj : {};
			var i = {
				data: n,
				action: {},
				virtual: ""
			};
			var j = c.appBannerType;
			var f = function() {
				$("#" + c.appBannerID).attr("search_land_searchTransformation_show", "true");
				c.indexFloatLayerRunOpen = true;
				$("#topheader").css("display", "none");
				c.beenshield = true
			};
			var k = [{
				topen: "MDownLoadFloatTop_OpenC",
				tsf: "homeBtop",
				tchannel: "jd-msy1"
			}];
			var d = k[0];
			switch(j) {
				case 0:
					i.virtual = "MDownLoadFloatTop_Expose_VirtualC";
					i.action = {
						beforedom: "index_search_main",
						bannerid: c.appBannerID,
						openappid: c.openapp,
						closebtnid: c.openweb,
						downAppURl: "//h5.m.jd.com/active/download/download.html?channel=" + d.tchannel,
						closecallback: f,
						openEvent: d.topen,
						closeEvent: "MDownLoadFloatTop_CloseC",
						appDownCloseIntervalTime: c.closebannertime,
						appDownOpenIntervalTime: c.openbannertime,
						sourceform: d.tsf
					};
					!!c.hasAppBanner && g.appBannerBind(i);
					break;
				default:
					break
			}
			try {
				var m = new MPing.inputs.Click(i.virtual);
				m.event_param = "";
				var h = new MPing();
				h.send(m)
			} catch(l) {
				c.log("mping virtual errpr", l)
			}
			if(!!!c.hasAppBanner) {
				c.indexFloatLayerRunOpen = true
			}
		},
		floatLayerInit: function(c) {
			var d = this;
			if(c && c.url && $.trim(c.url) != "0") {
				d.floatUrl = c.url;
				d.indexFloatLayerId = "indexFloatLayer";
				d.indexFloatLayerRunOpen = false;
				d.indexFloatLayerRunTimer = 0
			}
		},
		floatLayerRender: function() {
			var c = this;
			if(c.floatUrl) {
				c.thread.addOne({
					name: "floatLayer",
					event: function() {
						var e = this;
						if(e.indexFloatLayerRunOpen) {
							if($("#" + e.indexFloatLayerId).css("transform") == "none" || $("#" + e.indexFloatLayerId).css("-webkit-transform") == "none" || $("#" + e.indexFloatLayerId).css("transform") == "" || $("#" + e.indexFloatLayerId).css("-webkit-transform") == "" || $("#" + e.indexFloatLayerId).css("transform") == "translateX(0px)" || $("#" + e.indexFloatLayerId).css("-webkit-transform") == "translateX(0px)") {
								if(e.indexFloatLayerRunTimer > 12) {
									e.indexFloatLayerRunTimer = 0
								}
								e.indexFloatLayerRunTimer++;
								if(e.indexFloatLayerRunTimer == 12) {
									var d = {
										transform: "translateX(40px)",
										"-webkit-transform": "translateX(40px)",
										"-webkit-transition": "0.2s ease 0s",
										transition: "0.2s ease 0s"
									};
									$("#" + e.indexFloatLayerId).css(d);
									setTimeout(function() {
										var f = {
											transform: "translateX(40px)",
											"-webkit-transform": "translateX(40px)",
											"-webkit-transition": "",
											transition: ""
										};
										$("#" + e.indexFloatLayerId).css(f)
									}, 200)
								}
							} else {
								e.indexFloatLayerRunTimer = 0
							}
						}
					},
					source: c
				});
				c.floatLayerBind();
				$("#" + c.indexFloatLayerId).css("display", "block")
			}
		},
		floatLayerBind: function() {
			var c = this;
			if(c.floatUrl) {
				$("#" + c.indexFloatLayerId).on("click", function() {
					var d = {
						transform: "translateX(0px)",
						"-webkit-transform": "translateX(0px)",
						"-webkit-transition": "0.2s ease 0s",
						transition: "0.2s ease 0s"
					};
					$("#" + c.indexFloatLayerId).css(d);
					setTimeout(function() {
						location.href = c.floatUrl
					}, 200)
				})
			}
		},
		topLayerInit: function(c) {
			var d = this;
			if(!!c && !!c.id && !!c.img && !!c.url && !!c.srv) {
				d.toplayer = c
			}
		},
		topLayerRender: function() {
			var d = this;
			if(!!d.toplayer) {
				d.loadImage(d.toplayer.img);
				var c = "<div  search_land_searchTransformation_show='true' class='toplayer toplayerhidden' id='toplayer' ><a   report-eventid='MHome_BFloor' report-eventlevel='1'  report-eventparam='" + d.toplayer.srv + "' page_name='index'  class='J_ping' href='" + d.toplayer.url + "'><img  src='" + d.toplayer.img + "'/></a></div>";
				$("#fixedtop").append(c);
				d.toplayer.dom = $("#fixedtop").children().last()
			}
		},
		loadImage: function(d) {
			var f = this;
			var c = new Image();
			c.src = d;

			function e(g) {
				var j = g.width;
				var k = g.height;
				var i = $(window).width() > 640 ? 640 : $(window).width();
				var h = Math.ceil(i * k / j);
				f.topLayerHt = h
			}
			if(c.complete) {
				e(c);
				return
			}
			c.onload = function() {
				e(c)
			}
		},
		navigationhandler: function() {
			var d = this;
			if(!!!d.nocartnum) {
				var c = $("#sid").val();
				var e = !!c ? ("?sid=" + encodeURIComponent(c) + "&t=" + (Date.now())) : ("?t=" + (Date.now()));
				M.http.ajax({
					url: window.location.protocol + "//mapi.m.jd.com/cart/cart.json" + e,
					type: "get",
					success: function(g) {
						if(!!g) {
							var h = 0;
							try {
								if(!!g && !!g.sid && g.sid == c && !!g.cartJson && !!g.cartJson) {
									var f = g.cartJson;
									if(M.object.isNumber(f.resultCode) && f.resultCode == 0 && M.object.isObject(f.cartInfo) && !!f.cartInfo.type) {
										switch(f.cartInfo.type) {
											case "1":
												$(".bottom-bar-pannel img[func=cart]").after("<span class='cart-money'></span>");
												break;
											default:
												h = (!!f.cartInfo && !!f.cartInfo.Num) ? parseInt(f.cartInfo.Num) : 0;
												h = parseInt(h);
												h > 0 && $(".bottom-bar-pannel img[func=cart]").after("<span class='cart-num'>" + (h > 99 ? "99+" : h) + "</span>");
												break
										}
									}
								}
							} catch(i) {
								d.log("mapi data exception")
							}
						}
					},
					error: function() {
						d.log("mapi data exception")
					}
				})
			}
		},
		searchhandler: function() {
			var c = this;
			document.getElementById("index_newkeyword").addEventListener("click", function(g) {
				if(!!!c.searchLand.openSearchLoad) {
					try {
						var f = new MPing.inputs.Click("MHome_BSearch");
						f.event_param = "";
						f.event_level = "1";
						var d = new MPing();
						d.send(f)
					} catch(g) {}
				}
			});
			c.searchLand.render()
		},
		toRecommend: function() {
			var d = this;

			function c() {
				var f = parseInt($("#topheader").height());
				if(!!f) {
					var e = f + d.topLayerHt + 38
				} else {
					var e = d.topLayerHt + 38
				}
				d.recommendTopH = Math.ceil($("#recommend").offset().top - e);
				$("#topheader").css("display", "none");
				setTimeout(function() {
					window.scrollTo(0, d.recommendTopH);
					$("#" + d.recommendId).hide();
					$("#" + d.topId).show()
				}, 100)
			}
			if(!!d.botRecommend) {
				$("#botRecommend").on("click", function() {
					c();
					d.sendMping("MHome_BBottomTip", null, 1)
				})
			}
			$("#" + d.recommendId).on("click", function() {
				if($("#recommend").length == 0) {
					d.recommendRender(c)
				} else {
					c()
				}
				d.sendMping("MHome_HomeOne", null, 1)
			})
		},
		toTopBind: function() {
			var c = this;
			$("#" + c.topId).on("click", function() {
				$(this).hide();
				$("#" + c.recommendId).show();
				window.scrollTo(0, 0);
				var d = $("#" + c.appBannerID + "");
				if(d && d.height() > 0) {
					var e = $("#fixedtop");
					var f = $("#topheader");
					e.removeClass("showfixedtop-half").addClass("showfixedtop");
					f.css("display", "block");
					c.under = 1
				}
				if($("#slider").height() > 0) {
					$($("#index_search_head").children()[0]).css("opacity", 0)
				}
				c.sendMping("MHome_HomeTwo", null, 1)
			})
		},
		recordIndexLoc: function() {
			var e = this;
			$("#index_searchLogin").on("click", function() {
				M.cookie.setCookie("location", $(window).scrollTop(), 0.0035, "", "jd.com")
			});
			var c = M.url.getParam("indexloc");
			if(c && c == "1") {
				var f = M.cookie.getCookie("location");
				M.cookie.delCookie("location");
				var d = parseInt(f);
				if(!isNaN(d)) {
					$(window).on("load", function() {
						window.scrollTo(0, d);
						if(d >= 50) {
							var g = $("#" + e.appBannerID + "");
							if(g && g.height() > 0) {
								topheader.css("display", "none");
								fixedtop.removeClass("showfixedtop").addClass("showfixedtop-half")
							}
						}
					})
				}
			}
		},
		recommendInit: function(d) {
			var c = this;
			if(d) {
				c.recommendPin = d.pin;
				c.recommendUesCached = d.useCached;
				c.recommendOpen = d.open;
				c.recommendPage = 0;
				c.recommendPageCount = 1;
				c.recommendDataCount = 0;
				c.recommendListId = "recommendList";
				c.recommendListLoadId = "recommendListload";
				c.recommendListloadImg = "recommendListloadImg";
				c.recommendListLoadMoreBtn = "recommendListLoadMoreBtn";
				c.recommendCanLoad = true;
				c.recommendloadHeight = 0;
				c.hasRecommenddata = true
			}
		},
		firstRecommend: function(e) {
			var d = this;
			if(d.recommendPage == 0) {
				var c = d.recommendMainHtml(e);
				$("#newviewport").append(c);
				d.recommendBind();
				d.recommendAddExposeBind()
			}
		},
		recommendLoadData: function(m) {
			var c = this;
			if(c.recommendCanLoad && c.hasRecommenddata) {
				c.recommendCanLoad = false;
				$("#" + c.recommendListLoadId).css("display", "block;");
				$("#" + c.recommendListloadImg).css("display", "block;");
				$("#" + c.recommendListLoadMoreBtn).css("display", "none;");
				var n = "indexRecommendData_new";
				var h = null;
				if(c.recommendUesCached) {
					var d = M.localstorage.get(n);
					try {
						d = JSON.parse(d)
					} catch(j) {
						c.log("Line728_dataArr");
						d = null
					}
					if(d && d.length == 2) {
						if(c.recommendPin) {
							h = d[1];
							if(h.length >= (c.recommendPage + 1)) {
								h = h[c.recommendPage]
							} else {
								h = null
							}
						} else {
							h = d[0];
							if(h.length >= (c.recommendPage + 1)) {
								h = h[c.recommendPage]
							} else {
								h = null
							}
						}
						if(!h || (new Date().getTime() - h.updateTime) > (4 * 60 * 60 * 1000) || h.pin != c.recommendPin) {
							h = null
						}
					} else {
						try {
							var k = JSON.stringify([
								[],
								[]
							]);
							M.localstorage.set(n, k)
						} catch(j) {}
					}
				} else {
					M.localstorage.remove(n)
				}
				if(h == null) {
					var l = M.url.getParam("forcebot");
					var i = (!!l && l == 1) ? "&forcebot=1" : "";
					M.http.ajax({
						url: "/index/recommend.action",
						data: "_format_=json&page=" + (c.recommendPage + 1),
						type: "GET",
						success: function(o) {
							var p = false;
							var r = false;
							if(o && o.recommend) {
								try {
									h = JSON.parse(o.recommend)
								} catch(u) {
									c.log(u, "error");
									h = null;
									c.hasRecommenddata = false
								}
								if(h && h.wareInfoList && h.wareInfoList.length > 0) {
									h.recommendList = h.wareInfoList
								}
								if(h && h.recommendList && h.recommendList.length == 0) {
									c.hasRecommenddata = false;
									r = true
								}
								if(h && h.recommendList && h.recommendList.length > 0) {
									c.firstRecommend(h);
									var s = Math.floor(c.recommendDataCount / 2);
									var t = c.recommendListHtml(h);
									$("#" + c.recommendListId).append(t);
									setTimeout(function() {
										$("#" + c.recommendListId).find(".sam-price").each(function() {
											c.similarPriceFontSize(this)
										})
									}, 100);
									c.calculationRecommendImg();
									if(c.recommendUesCached) {
										h.updateTime = new Date().getTime();
										h.pin = c.recommendPin;
										var q = M.localstorage.get(n);
										try {
											q = JSON.parse(q)
										} catch(u) {
											q = null
										}
										if(q && M.object.isArray(q)) {
											if(c.recommendPin) {
												if(q[1].length >= (c.recommendPage + 1)) {
													q[1][c.recommendPage] = h
												} else {
													q[1].push(h)
												}
											} else {
												if(q[0].length >= (c.recommendPage + 1)) {
													q[0][c.recommendPage] = h
												} else {
													q[0].push(h)
												}
											}
										}
										try {
											M.localstorage.set(n, JSON.stringify(q))
										} catch(u) {}
									}
									c.recommendPage++;
									var v = M.url.getParam("recommend");
									if(v == "1" && c.recommendPage == 1) {
										M.url.setHash("recommend");
										window.location = window.location
									}
									c.imgLazyLad.lazyLad();
									c.recommendloadHeight = $("#scwrapper").height() - $("#" + c.recommendListId).find("li").eq(0).height() * 4;
									if(c.recommendPage % 3 == 0 && c.hasRecommenddata) {
										p = true
									} else {
										p = false
									}
									r = true
								}
							}
							if(r) {
								if(p) {
									$("#" + c.recommendListLoadId).css("display", "block;");
									$("#" + c.recommendListloadImg).css("display", "none;");
									$("#" + c.recommendListLoadMoreBtn).css("display", "block;")
								} else {
									$("#" + c.recommendListLoadId).css("display", "none;");
									$("#" + c.recommendListloadImg).css("display", "none;");
									$("#" + c.recommendListLoadMoreBtn).css("display", "none;");
									c.recommendCanLoad = true
								}
							} else {
								c.recommendloadHeight = $("#scwrapper").height() - $("#" + c.recommendListId).find("li").eq(0).height() * 4;
								c.recommendCanLoad = false;
								$("#" + c.recommendListLoadId).css("display", "none;");
								$("#" + c.recommendListloadImg).css("display", "none;");
								$("#" + c.recommendListLoadMoreBtn).css("display", "none;")
							}
							if(M.object.isFunction(m)) {
								try {
									m()
								} catch(u) {}
							}
						},
						error: function() {
							c.recommendloadHeight = $("#scwrapper").height() - $("#" + c.recommendListId).find("li").eq(0).height() * 4;
							c.recommendCanLoad = false;
							$("#" + c.recommendListLoadId).css("display", "none;");
							$("#" + c.recommendListloadImg).css("display", "none;");
							$("#" + c.recommendListLoadMoreBtn).css("display", "none;")
						}
					})
				} else {
					c.firstRecommend(h);
					var f = c.recommendListHtml(h);
					$("#" + c.recommendListId).append(f);
					c.calculationRecommendImg();
					var g = M.url.getParam("recommend");
					c.recommendPage++;
					c.recommendloadHeight = $("#scwrapper").height() - $("#" + c.recommendListId).find("li").eq(0).height() * 4;
					if(g == "1" && c.recommendPage == 1) {
						M.url.setHash("recommend");
						window.location = window.location
					}
					c.imgLazyLad.lazyLad();
					if(c.recommendPage % 3 == 0 && c.hasRecommenddata) {
						$("#" + c.recommendListLoadId).css("display", "block;");
						$("#" + c.recommendListloadImg).css("display", "none;");
						$("#" + c.recommendListLoadMoreBtn).css("display", "block;")
					} else {
						$("#" + c.recommendListLoadId).css("display", "none;");
						$("#" + c.recommendListloadImg).css("display", "none;");
						$("#" + c.recommendListLoadMoreBtn).css("display", "none;");
						c.recommendCanLoad = true
					}
				}
			}
			c.recommendhasrender = true
		},
		recommendMainHtml: function(e) {
			var d = this;
			var c = [];
			if(e && e.recommendList && e.recommendList.length > 0) {
				c.push('<div id="recommend" class="floor love-floor">');
				c.push('<div class="gray-text"><span class="gray-layout"><span class="gray-text-img"></span>\u4e3a\u60a8\u63a8\u8350</span></div>');
				c.push('<ul class="find-similar-ul cf" data-floor="Mhome_BRecommend" id="' + d.recommendListId + '">');
				c.push("</ul>");
				c.push('<div style="clear: left;"></div>');
				c.push('<div style="display: none;" class="swipe-up love-loading" id="' + d.recommendListLoadId + '">');
				c.push('<div class="swipe-up-wrapper ">');
				c.push('<div style="display: none;" id="' + d.recommendListloadImg + '" class="loading-con">');
				c.push('<span class="pagenum" id="showPageID"></span>');
				c.push('<span class="loading"><i class="love-loading-icon">\u52a0\u8f7d\u4e2d\u002e\u002e\u002e</i></span>');
				c.push('<div class="clear"></div>');
				c.push("</div>");
				c.push('<div style="display: none;" id="' + d.recommendListLoadMoreBtn + '" class="click-loading"><a href="javascript:void(0);">\u70b9\u51fb\u7ee7\u7eed\u52a0\u8f7d</a></div>');
				c.push("</div>");
				c.push("</div>");
				c.push("</div>")
			}
			return c.join("")
		},
		recommendListHtml: function(x) {
			var q = this;
			var w = q.url == null ? "" : q.url;
			var n = [];
			var d = "";
			if(x && x.recommendList && x.recommendList.length > 0) {
				for(var t = 0; t < x.recommendList.length; t++) {
					var r = x.recommendList[t];
					var h = r.itemType;
					var e = r.clickUrl;
					if((h && h != "0" && h != "1") || (r.type && r.type != "ware")) {
						continue
					}
					q.recommendDataCount++;
					if(t == 0 && h == "0") {
						if(!!r.imageurl && !!r.wname && !!r.jdPrice) {
							d += '<div class="recommend-box">';
							d += '<div class="botRec-img"><img src="' + (!!r.imageurl ? r.imageurl.replace(/http:/g, "") : "") + '"/></div>';
							d += '<div class="botRec-info">';
							d += '<p class="botRec-title">' + r.wname + "</p>";
							d += '<p class="botRec-money"><i class="love"></i>猜你喜欢<span>&yen;&nbsp;' + r.jdPrice + "</span></p>";
							d += "</div>";
							d += '<div class="goRec-arrow"></div>';
							d += '<i class="botRec-arrow"></i>';
							d += "</div>";
							$("#botRecommend").append(d)
						}
					}
					if(h == "0") {
						n.push('<li class="similar-li"><a  ' + ((!!e) ? (' clickUrl="' + e + '" ') : "") + ' class="J_ping" report-eventlevel="1" report-eventid="MHomeGuessYouLike_BProducts"  report-eventparam="' + r.sourceValue + '" page_name="index" href="//item.m.jd.com/product/' + r.wareId + '.html">');
						n.push('<div  class="similar-product"><div class="similar-posre"><img class="Jschangewidth" alt="' + r.wname + '"  src="' + w + '/images/index/m-home-pic-new.png" imgsrc="' + (!!r.imageurl ? r.imageurl.replace(/http:/g, "") : "") + '" >');
						if(!!r.recomReason) {
							n.push('<p class="similar-tipwz">' + r.recomReason + "</p>")
						}
						n.push("</div>");
						n.push('<span class="similar-product-text">');
						var f = false,
							g = false;
						if(!!r.wareType && r.wareType == "8") {
							n.push('<img src="' + (!!r.markImageUrl ? r.markImageUrl.replace(/http:/g, "") : "") + '" style="' + (!!r.markWidth ? ("width:" + r.markWidth + "px;") : "") + (!!r.markHeight ? ("height:" + r.markHeight + "px;") : "") + '" class="chosen">');
							g = true
						} else {
							if(!!r.isSamWare && (!!!r.wareType)) {
								n.push('<img src="' + q.url + '/images/index/samsb.png" class="samsb">');
								f = true
							}
						}
						n.push(r.wname + "</span>");
						n.push('<p class="similar-product-info">');
						n.push('<span class="similar-product-price">');
						if(!!r.jdPrice) {
							r.jdPrice = r.jdPrice + "";
							var l = r.jdPrice.split(".");
							if(!!l) {
								n.push("&yen;&nbsp;");
								if(!!l[0]) {
									n.push('<span class="big-price">' + l[0] + "</span>")
								}
								if(!!l[1]) {
									n.push('<span class="small-price">.' + l[1] + "</span>")
								}
							}
						}
						n.push("</span>");
						if(!!r.markImageUrlPrice && !!!r.isPlusWare && !!!r.isSamWare) {
							n.push('<span class="similar-iconC"><img src="' + r.markImageUrlPrice.replace(/http:/g, "") + '"></span>')
						}
						if(!!r.isSamWare && !!r.samPrice && !!!r.isPlusWare) {
							var m = r.samPrice + "";
							var p = m.length - 3;
							n.push('<span class="sam-price"  data-priceLen=' + p + ">&yen;&nbsp;" + m + "</span>")
						}
						if(!!r.isPlusWare && !!!r.isSamWare) {
							var o = r.tryPlusPrice + "";
							var p = o.length - 3;
							n.push('<span class="sam-price plus-price"  data-priceLen=' + p + ">&yen;&nbsp;" + o + "</span>")
						}
						n.push("</p>");
						n.push('<p class="praise-info">');
						if(!!r.good) {
							var c = r.good.toString().split(".");
							if(!!c[1] && c[1].length > 2) {
								c[1] = c[1].substring(0, 2) + "%";
								r.good = c[0] + "." + c[1]
							}
							n.push('<span class="praise-num"><span>好评率' + r.good + "</span></span>")
						}
						n.push('<span class="guess-button J_ping" report-eventlevel="1" report-eventid="MHomeGuessYouLike_BSimilarities"  report-eventparam="' + (q.recommendPage * 20 + t + 1) + "_" + r.wareId + '_1" page_name="index" onclick="event.preventDefault();window.location.href=\'//home.m.jd.com/myjd/similar/list.action?skuId=' + r.wareId + "'\"  >\u770b\u76f8\u4f3c</span></p>");
						n.push("</div></a>");
						n.push("</li>")
					} else {
						if(h == "1") {
							if(!!r.imageurl && r.wname && r.followCount) {
								var k = r.subWareList;
								var v = [];
								if(k && k.length > 0) {
									for(var s = 0, u = k.length; s < u; s++) {
										if(!!k[s].wareId && !!k[s].imageUrl) {
											v.push(k[s])
										}
									}
								}
								if(v.length >= 2) {
									n.push('<li class="similar-li similar-shop">');
									n.push('<div class="shop-posre"><img class="shop-seat" src="' + q.url + '/images/index/load/similar-shop.png">');
									n.push('<div class="similar-product"><a class="J_ping" report-eventlevel="1" report-eventid="MHome_BRecommendShop"  report-eventparam="' + r.sourceValue + '" page_name="index"  href="https://shop.m.jd.com/?shopId=' + r.wareId + '">');
									n.push('<p class="smshop-logo" ><img src="' + (!!r.imageurl ? r.imageurl.replace(/http:/g, "") : "") + '"></p>');
									n.push('<p class="smshop-name"><i></i>' + r.wname + "</p>");
									n.push('<p class="smshop-num">' + r.followCount + "人关注</p>");
									n.push('<p class="smshop-btn"><span>查看店铺</span></p>');
									n.push('<p class="sm-line"><span></span><i></i></p>');
									n.push("</a>");
									n.push('<div class="sm-imglist">');
									n.push('<a class="sm-imgitem J_ping"  report-eventlevel="1" report-eventid="MHome_BRecommendShopProduct"  report-eventparam="' + v[1].wareId + '" page_name="index"    href="https://shop.m.jd.com/?shopId=' + r.wareId + "&homeSku=" + v[0].wareId + '" >');
									n.push('<img  src="' + (v[0].imageUrl.replace(/http:/g, "")) + '">');
									n.push("</a>");
									n.push('<a class="sm-imgitem J_ping"  report-eventlevel="1" report-eventid="MHome_BRecommendShopProduct"  report-eventparam="' + v[1].wareId + '" page_name="index"    href="https://shop.m.jd.com/?shopId=' + r.wareId + "&homeSku=" + v[1].wareId + '" >');
									n.push('<img  src="' + (v[1].imageUrl.replace(/http:/g, "")) + '">');
									n.push("</a>");
									n.push("</div>");
									n.push("</div></div>");
									n.push('<a class="J_ping" report-eventlevel="1" report-eventid="MHome_BRecommendShop"  report-eventparam="' + r.sourceValue + '" page_name="index"   href="https://shop.m.jd.com/?shopId=' + r.wareId + '">');
									n.push("</a>");
									n.push("</li>")
								}
							}
						}
					}
				}
			}
			return n.join("")
		},
		recommendAddExposeBind: function() {
			document.getElementById("recommend").addEventListener("click", function(f) {
				try {
					var d = f.target || f.srcElement;
					while(d.id != "recommend" && d.tagName.toLowerCase() != "a") {
						d = d.parentNode
					}
					if(d.tagName.toLowerCase() == "a") {
						var c = d.getAttribute("clickUrl");
						if(c != null) {
							$.getJSON(c + "&jsoncallback=?", function(e) {})
						}
					}
				} catch(f) {
					source.log("recommendAddExposeBind error!", f)
				}
			})
		},
		recommendBind: function() {
			var c = this;
			if(c.recommendOpen) {
				$("#" + c.recommendListLoadMoreBtn).on("click", function(d) {
					c.recommendCanLoad = true;
					c.recommendLoadData()
				})
			}
		},
		recommendRender: function(c) {
			var d = this;
			if(d.recommendOpen && !d.recommendhasrender) {
				d.recommendLoadData(c);
				d.recommendhasrender = true
			}
		},
		similarPriceFontSize: function(d) {
			var c = $(d).data("pricelen");
			if(c >= 6) {
				c = 6
			}
			if(c > 2) {
				$(d).parent(".similar-product-info").addClass("priceSize" + c)
			}
		},
		calculationRecommendImg: function() {
			var d = this;
			var c = $("body").width();
			$("#" + d.recommendListId).find(".Jschangewidth").forEach(function(f, e) {
				var g = $(f).parent().width();
				$(f).css({
					width: g,
					height: g
				})
			});
			$("#" + d.recommendListId).find(".similar-shop").forEach(function(f, e) {
				var g = $(f).find(".shop-seat").width() + 95;
				$(f).find(".shop-posre").css({
					height: g
				})
			});
			$("#" + d.recommendListId).find(".smshop-logo").forEach(function(f, e) {
				var g = $(".similar-product").width() - 68;
				$(f).find("img").css({
					height: g / 3
				})
			});
			$("#" + d.recommendListId).find(".sm-imgitem").forEach(function(f, e) {
				var g = ($(".similar-product").width() - 14) / 2 - 6;
				$(f).find("img").css({
					height: g
				})
			})
		},
		resizeFunction: function() {
			var f = this;
			var d = "onorientationchange" in window;
			var c = d ? "orientationchange" : "resize";
			var e = null;
			if(this.seclayout) {
				e = this.seclayout.urlobj.find("img");
				f.resizeSeckZone();
				var g = e.length;
				e.each(function() {
					var h = this;
					h.onload = function() {
						g--;
						if(g % 4 == 0) {
							f.resizeSeckimg(e)
						}
					}
				})
			}
			$(window).on(c, function() {
				if(f.recommendOpen && f.recommendCanLoad) {
					f.recommendloadHeight = $("#scwrapper").height() - $("#" + f.recommendListId).find("li").eq(0).height() * 4
				}
				f.calculationRecommendImg();
				try {
					var i = navigator.userAgent.indexOf("iPhone") >= 0 && navigator.userAgent.indexOf("MQQBrowser") >= 0;
					if(!i && f.seclayout) {
						f.resizeSeckZone();
						f.resizeSeckimg(e, true)
					}
				} catch(j) {
					f.log("resizeSeckimg error!", j)
				}
				f.imgLazyLad.lazyLad();
				f.imgLazyLad.squareImg(".square-img");
				var h = $(".shop-img").width() / 2;
				$(".shop-img").find("img").css({
					width: h,
					height: h
				})
			})
		},
		resizeSeckZone: function() {
			var f = this.seclayout;
			if(f == null || f.seclist == null || f.seclist.length <= 3) {
				return
			}
			var d = f.urlobj.find("li");
			var g = (f.container.width() - 50) / 3;
			for(var e = 0, c = d.length - 1; e < c; e++) {
				d[e].style.width = g + "px"
			}
			f.gapwidth = g;
			f.urlwidth = g * (d.length - 1) + f.more;
			f.urlobj.width(f.urlwidth);
			if(f.touchobj) {
				f.touchobj.fixetRootWidth(f.urlwidth - f.container.width());
				f.touchobj.basegap = f.gapwidth;
				f.touchobj.goToEnd(10, f.touchobj.tar, f.touchobj.rootWidth, null)
			}
		},
		resizeSeckimg: function(g, f) {
			for(var e = 0, c = g.length; e < c; e++) {
				var d = parseInt($(g[e]).width(), 10);
				var h = parseInt($(g[e]).height(), 10);
				if(f || d != h) {
					$(g[e]).height(d + "px")
				}
			}
		},
		loadSeckimg: function(g, f) {
			var j = ($(window).width() - 20) / 3;
			for(var e = 3, c = g.length; e < c; e++) {
				g[e].style.width = j + "px";
				g[e].style.height = j + "px";
				var d = parseInt($(g[e]).width(), 10);
				var h = parseInt($(g[e]).height(), 10);
				if(f || d != h) {
					$(g[e]).height(d + "px")
				}
			}
		},
		sliderlazyload: function(A) {
			var t = this;
			var r = t._lazyslider;
			if(r == null) {
				return
			}
			var o = r.list;
			if(r.count >= o.length) {
				return
			}
			var F = new Date();
			var n = t.$h ? t.$h : t.$.height();
			var f = !!A ? A : t.$.scrollTop();
			for(var x = 0, y = o.length; x < y; x++) {
				if(o[x].created) {
					continue
				}
				var h = $(o[x].id);
				if(h.length == 0) {
					continue
				}
				var p = h.offset().top - n - 200;
				if(parseInt(f) >= parseInt(p)) {
					for(var w = x, z = t.hybridslider.length; w < z; w++) {
						var c = t.hybridslider[w];
						var d = [];
						var C = c.floorid;
						var s = c.no;
						if(o[x].id.indexOf(C + "_" + s) < 0) {
							continue
						}
						t._lazyslider.count++;
						o[x].created = true;
						var E = c.sliderlist;
						for(var v = 1, B = E.length; v < B; v++) {
							var g = E[v];
							d.push('<li  data-ul-child="child"  class="slide-li"  ><a class="J_ping" report-eventlevel="1" report-eventid="MHome_BFloor" report-eventparam="' + g.sourceValue + '" page_name="index" href="' + g.url + '" ><img   _src="' + g.img.replace(/http:/g, "") + '"  /></a></li>')
						}
						d = d.join("");
						var l = $("#slider_" + C + "_" + s + "_touch");
						l.append(d);
						var q = l.children("li").first().height() + "px";
						l.css({
							"min-height": q,
							overflow: "hidden"
						});
						var u = slide("#slider_" + C + "_" + s);
						try {
							u.init({
								loop: true,
								_floorid: C,
								smallBtn: true,
								autoPlay: true,
								autoHeight: true,
								playTime: 3000,
								callback: function(e) {
									k(t, this._floorid, e)
								}
							});
							t.slider.push(u)
						} catch(D) {
							t.log(o[x].id + " error!", D)
						}
					}
				}
			}

			function k(m, j, i) {
				if(!!m.searchLand.openSearchLoad) {
					return
				}
				if(!!!m.ishttpinvoke) {
					return
				}
				i--;
				if(m._hybridslider == null || m._hybridslider[j] == null) {
					return
				}
				var e = m._hybridslider[j];
				if(!m.inviewport("#slider_" + e.floorid + "_" + e.no)) {
					return
				}
				var G = e.sliderlist;
				if(G == null || G[i] == null || G[i].exposalUrl == null || G[i].exposalUrl == "" || !!G[i].hasexposal) {
					return
				}
				G[i].hasexposal = true;
				m.imgHttp(G[i].exposalUrl)
			}
		},
		inviewport: function(f) {
			if(f == null || $(f) == null) {
				return false
			}
			var d = this;
			var e = d.$.scrollTop();
			var c = $(f).offset().top;
			if(!!!d.$h) {
				d.$h = d.$.height()
			}
			return c >= e && c <= (e + d.$h)
		},
		showtoplayer: function(c) {
			var f = this;
			if(f.toplayer == null || f.toplayer.dom == null || !!!f.toplayer.id) {
				return false
			}
			var g = !!c ? c : f.$.scrollTop();
			var e = $("div[ceilingid]");
			if(!!!f.toplayer.firsttime) {
				f.toplayer.sear_h = $("#index_search_main").height();
				f.toplayer.att_h = e.height();
				f.toplayer.wh2 = 2.5 * f.$h
			}
			if(e.length == 1) {
				if(e.attr("ceilingid") == f.toplayer.id) {
					var d = ((g + f.toplayer.sear_h) >= e.offset().top + f.toplayer.att_h) ? ["toplayerhidden", "toplayershow"] : ["toplayershow", "toplayerhidden"];
					f.toplayer.dom.removeClass(d[0]).addClass(d[1])
				}
			} else {
				if(e.length == 0 && !!!f.toplayer.target) {
					var d = ((g) >= f.toplayer.wh2) ? ["toplayerhidden", "toplayershow"] : ["toplayershow", "toplayerhidden"];
					f.toplayer.dom.removeClass(d[0]).addClass(d[1])
				}
			}
			f.toplayer.firsttime = true
		},
		imgHttp: function(c) {
			if(c == null || c == "") {
				return
			}
			var e = this;
			var f = new Image(1, 1);
			var d = c.indexOf("?") > -1 ? (c + "&_=" + new Date().getTime()) : (c + "?_=" + new Date().getTime());
			f.src = d
		},
		scrollFunction: function() {
			var n = this;
			var g, m, q, r, u, y, w, o, s, x, z, e, h, p;
			var k = 1;
			var d = {};
			n.under = 1;
			o = 0, s = 0.9;
			$(document).ready(function() {
				g = $($("#index_search_head").children()[0]);
				m = $("#index_search_main");
				q = $("#fixedtop");
				r = $("#topheader");
				z = $("#" + n.appBannerID + "");
				var f = $("#slider");
				sliderH = $("#slider").height() / 2;
				u = g.height();
				y = f.height() - u;
				h = z.height();
				n.$h = n.$.height();
				n.searchbarrgb = g.css("opacity");
				x = 1;
				p = 1
			});
			n.$.on("load", function() {
				y = y < 0 ? ($("#slider").height() - u) : y;
				x = $(window).scrollTop() <= y ? 0 : 1;
				setTimeout(function() {
					var K = $(window).scrollTop();
					x = K <= y ? 0 : 1;
					j(K);
					if(K > 0) {
						n.imgLazyLad.lazyLad()
					}
					n.imgLazyLad.squareImg(".square-img");
					var J = $(".shop-img").width() / 2;
					$(".shop-img").find("img").css({
						width: J,
						height: J
					})
				}, 0);
				var I = $(window).scrollTop();
				if(navigator.userAgent.indexOf("baidubrowser") > 0 && navigator.userAgent.indexOf("Android") > 0 && I > 0) {
					window.scrollTo(0, I + 1)
				}
				var G = 3;
				var D = setInterval(function() {
					if(n.hasAppBanner && (z != null && (z.css("display") == "none" || z.height() == 0)) && (r.css("display") == "block")) {
						r.css("display", "none");
						n.beenshield = true
					}
					if(--G == 0) {
						clearInterval(D)
					}
				}, 200);
				setTimeout(function() {
					if(n.$.scrollTop() > 200 || $("#scwrapper").height() <= n.$.height()) {
						n.recommendRender()
					}
				}, 100);
				var E = navigator.userAgent.indexOf("MX");
				if(E != -1) {
					$(".graphic-img img").css({
						height: "auto"
					});
					$(".floor-tit-img .tit-img").css({
						height: "auto",
						width: "22%"
					})
				}
				if($("#scroll-news").length > 0) {
					var f = Number(n.rotatetime);
					setInterval(function() {
						$("#scroll-news").find(".news-list").animate({
							"-webkit-transform": "translate3d(0px,-23px, 0px)",
							transform: "translate3d(0px,-23px, 0px)"
						}, 500, "ease", function() {
							$(this).css({
								"-webkit-transform": "translate3d(0px,0px, 0px)",
								transform: "translate3d(0px,0px, 0px)"
							}).find("li:first").appendTo(this)
						})
					}, isNaN(f) ? 3000 : f * 1000)
				}
				if(n.ismeritco && !!n.meritcopin) {
					setTimeout(function() {
						M.http.ajax({
							url: "http://" + n.meritcopin + ".web.meritco.m.jd.com?t=" + (Date.now()),
							type: "get",
							success: function() {}
						});
						try {
							var K = new MPing.inputs.Click("MHome_BPageVirtual");
							K.event_param = n.meritcopin;
							var J = new MPing();
							J.send(K)
						} catch(L) {
							n.log("mping jiuqian errpr", L)
						}
					}, 0)
				}
				if(!n.noscreenlog) {
					setTimeout(function() {
						var J = !!window.devicePixelRatio ? window.devicePixelRatio : -1;
						var K = !!navigator.serviceWorker ? 1 : 0;
						M.http.ajax({
							url: "/index/screen.json?a=" + window.screen.width + "&b=" + J + "&c=" + K + "&r=" + new Date().getTime(),
							type: "get",
							success: function() {}
						})
					}, 0)
				}
				if(n.openReportTime) {
					try {
						if(!!rTimeArr && M.object.isArray(rTimeArr)) {
							rTimeArr[7] = {
								time: new Date(),
								sTime: "0"
							};
							var C = new R_Time();
							var H = C.calculateTime(rTimeArr);
							var A = C.urlParse("sid") || "";
							var B = C.extend({
								id: "137",
								flag: "1",
								sid: A
							}, H);
							C.sendTime(B)
						}
					} catch(F) {
						n.log("reporttime error!", F)
					}
				}
			});

			function j(D) {
				if(!!!n.hasActivityImg) {
					g.css("opacity", 0.9);
					return
				}
				var f = D;
				if(f <= y) {
					g.css("opacity", f < u ? o : s * ((f - u) / y));
					x = 1
				} else {
					if(x == 1) {
						g.css("opacity", s);
						x = 0
					}
				}
				if($("#recommend").length > 0) {
					var A = parseInt($("#topheader").height());
					if(!!A) {
						var F = A + n.topLayerHt + 38
					} else {
						var F = n.topLayerHt + 38
					}
					n.recommendTopH = Math.ceil($("#recommend").offset().top - F);
					if(Math.ceil(f) < n.recommendTopH) {
						$("#" + n.topId).hide();
						$("#" + n.recommendId).show()
					} else {
						$("#" + n.topId).show();
						$("#" + n.recommendId).hide()
					}
				}
				var H = $(window).scrollTop();
				var C = !!$("#search-box-new").height() ? $("#search-box-new").height() : 0;
				var E = $("#slider").height() + C - 38;
				if($("#recommend").length > 0 && $("#bar-recommend").length > 0) {
					var G = Math.ceil($("#recommend").offset().top - $(window).height() + $("#bar-recommend").height());
					n.recommendShowTime = !!n.recommendShowTime ? n.recommendShowTime : 3000;
					var B = n.recommendShowTime + n.recommendAnimationTime;
					if(!!n.botRecommend) {
						if(H < E || H >= G) {
							$("#botRecommend").removeClass("ScaleShow")
						}
						if(M.cookie.getCookie("recommendShow") != "show") {
							if(H >= E && H < G) {
								$("#botRecommend").addClass("ScaleShow");
								n.recommendExpiresTime = !!n.recommendExpiresTime ? n.recommendExpiresTime : 1;
								M.cookie.setCookie("recommendShow", "show", Number(n.recommendExpiresTime), "", "jd.com");
								n.sendMping("MHome_BBottomTipExpo")
							}
						}
						setTimeout(function() {
							$("#botRecommend").removeClass("ScaleShow")
						}, B)
					}
				}
			}
			var t = null;
			var l = 0;
			if(n.seclayout) {
				t = n.seclayout.urlobj.offset();
				l = t.height + t.top
			}
			n.$.on("touchstart", function(f) {
				n.stopTime = 0;
				v = false;
				i = false;
				var A = f.touches[0];
				d.starty = A.clientY;
				d.startx = A.clientX;
				d.inity = d.starty;
				d.scrolly = 0;
				d.lastdate = Date.now();
				d.lastY = 0;
				d.secondzone = f.touches[0].pageY <= l
			});
			n.$.on("touchmove", function(C) {
				var E = C.touches[0];
				var A = E.clientY;
				var B = E.clientX;
				var f = n.$.scrollTop();
				if(f < 0) {
					return
				}
				d.diry = A - d.starty;
				d.dirx = B - d.startx;
				if(Math.abs(d.diry) <= Math.abs(d.dirx)) {
					direct = 0;
					return
				}
				var D = A - d.starty;
				if(D * d.lastgap < 0) {
					d.inity = A
				}
				d.scrolly = A - d.inity;
				if(d.diry < 0) {
					j(f + Math.abs(d.scrolly))
				} else {
					j(f - Math.abs(d.scrolly))
				}
				d.starty = A;
				d.startx = B;
				d.lastgap = D
			});
			$(window).on("touchend", function(F) {
				if(!!n.indexBfloor) {
					var G = [];

					function D(I) {
						return !!I ? I : 0
					}
					var A = $(window).height();
					if($("#recommend").length > 0) {
						var E = $("#recommend").offset().top
					}
					var C = D($(".floor-tit-img").height());
					var f = D($(".bottom-bar-pannel").height());
					var H = D($("#toplayer").height()) + 38;
					n.stopTouchTime = !!n.stopTouchTime ? n.stopTouchTime : 1500;
					var B = setTimeout(function() {
						n.stopTime = n.stopTouchTime;
						if(n.stopTime >= n.stopTouchTime) {
							var I = n.$.scrollTop();
							var O = I + A - f - C;
							$(".floor-title").each(function() {
								var P = $(this).offset().top;
								var S = $(this).siblings(".floor-container ").height();
								var R = $(this).attr("data-floorName");
								var Q = $(this).closest(".floor ").find(".floor-container").attr("data-floor");
								if(I < P && P < O && !!!Q) {
									G.push(R)
								}
								var T = P + S - H + C;
								if(I < T && P < O && !!Q) {
									n.sendMping(Q + "Expo")
								}
							});
							var K = G.length;
							if(K > 0) {
								n.sendMping("MHome_BfloorExpo", G[K - 1])
							}
							if($("#recommend").length > 0) {
								if(I + A - f > E) {
									var J = $("#recommendList li").height();
									var N = $(window).height() - D($(".bottom-bar-pannel").height()) - $("#recommendList").offset().top;
									var L = Math.ceil((I + N) / J);
									n.sendMping("Mhome_BRecommendExpo", L)
								}
							}
						}
						clearTimeout(B)
					}, n.stopTouchTime)
				}
				if(!!n.indexSlide && !!!n.bSlide) {
					if(d.diry < 0) {
						n.sendMping("MHome_Bslide");
						n.bSlide = true
					}
				}
				if(d.secondzone) {
					if(d.diry < 0 && n.$.scrollTop() >= 0) {
						setTimeout(function() {
							if(!n.beenshield) {
								var I = z.height();
								if(I == null || I == 0) {
									return
								}
								r.css("display", "none");
								q.removeClass("showfixedtop").addClass("showfixedtop-half")
							}
						}, 50)
					}
				} else {}
			});
			var v = false,
				c = 0,
				i = false;
			n.$.scroll(function(C) {
				var A = n.$;
				var f = A.scrollTop();
				if(f < 0) {
					return
				}
				var B = z ? z.height() : 50;
				if(!n.beenshield && B != null && B != 0) {
					if(f == 0) {
						if(!i) {
							q.removeClass("showfixedtop-half").addClass("showfixedtop");
							r.css("display", "block");
							n.under = 1;
							i = true
						}
					} else {
						r.css("display", "none");
						q.removeClass("showfixedtop").addClass("showfixedtop-half");
						k = 1
					}
				}
				j(f);
				if(n.recommendOpen) {
					if(n.recommendCanLoad && f >= n.recommendloadHeight) {
						n.recommendLoadData()
					}
				}
				n.imgLazyLad.lazyLad();
				if(!!!n.searchLand.openSearchLoad) {
					n.indexloc = f
				} else {
					r.css("display", "none")
				}
				n.sliderlazyload(f);
				n.showtoplayer(f)
			})
		},
		seckillImgScroll: function() {
			if(!this.seclayout) {
				return
			}
			var d = this.seclayout;
			var e = this.newseckillurl;
			if(d.seclist.length <= 3) {
				return
			}
			var c = new(M.exports("touchHandlerX").clazz)({
				target: d.urlobj[0],
				noscroll: false,
				basegap: d.gapwidth,
				other: this.slider
			});
			c.touchEndfn(function(f) {
				if(f < 0) {
					window.location.href = e
				}
			});
			d.touchobj = c;
			c.run();
			c.fixetRootWidth(d.urlwidth - d.container.width())
		},
		hotSearchList: function() {
			var c = this;
			c.searchLand.loadHotKeywordData({
				source: c,
				func: function(f) {
					if(M.object.isArray(f) && !!f[0]) {
						var d = c.searchHtml(f, "热门搜索");
						$("#hot-list").append(d).css("display", "block");
						$("#search-box-new").css("display", "block");
						$(".jd-search-container").addClass("redBg");
						var e = window.location.protocol + "//so.m.jd.com/ware/search.action?keyword=";
						$("#hot-list .recent-search-tags a").click(function() {
							var g = $(this).html();
							c.searchLand.homeSearchInfoAddHistory(g);
							window.location.href = e + g
						})
					}
				}
			})
		},
		historySearchList: function() {
			var c = this;
			c.searchLand.searchHistoryFromStorage({
				source: c,
				func: function(e) {
					if(M.object.isArray(e) && !!e[0]) {
						var d = c.searchHtml(e, "最近搜索");
						$("#his-list").append(d).css("display", "block");
						$("#search-box-new").css("display", "block");
						$(".jd-search-container").addClass("redBg");
						$("#his-list .recent-search-tags a").click(function() {
							var g = $(this).html();
							var f = $(this).data("href");
							c.searchLand.homeSearchInfoAddHistory(g);
							window.location.href = f
						})
					}
				}
			})
		},
		searchHtml: function(g, h) {
			var f = this;
			var d = [];
			d.push('<span class="search-title">' + h + "</span>");
			d.push('<p class="recent-search-tags">');
			if(h == "最近搜索") {
				for(var c = 0; c < g.length && c < 10; c++) {
					if(!!g[c].href && !!g[c].text) {
						d.push('<span><a class="J_ping"  page_name="index" report-eventlevel="1"    report-eventid="MHome_WordHistory" href="javascript:void(0);" data-href="' + g[c].href + '">' + g[c].text + "</a></span>")
					}
				}
			} else {
				var e = window.location.protocol + "//so.m.jd.com/ware/search.action?keyword=";
				for(var c = 0; c < g.length && c < 10; c++) {
					if(!!g[c]) {
						d.push('<span><a class="J_ping"  page_name="index" report-eventlevel="1"  report-eventid="MHome_WordHot"  href="javascript:void(0);">' + g[c] + "</a></span>")
					}
				}
			}
			d.push("</p>");
			return d.join("")
		},
		addSearchHtml: function() {
			var c = this;
			c.historySearchList();
			c.hotSearchList()
		},
		run: function() {
			var c = this;
			try {
				if(!!c.indexShowSearch) {
					if(c.isA()) {
						c.addSearchHtml()
					}
					c.sendAB("MHome_WordAB")
				}
			} catch(d) {
				c.log("SearchHtml error!", d)
			}
			try {
				c.appBannerBind()
			} catch(d) {
				try {
					$("#" + c.appBannerID + "").remove();
					$("#topheader").css("display", "none")
				} catch(d) {}
				c.log("Appbanner error!", d)
			}
			c.sliderHTML();
			c.appcenterHandler();
			try {
				if(c.endTime) {
					c.seckillRender()
				}
				c.resizeFunction();
				c.seckillImgScroll()
			} catch(d) {
				c.log("", d)
			}
			try {
				c.scrollFunction();
				c.recordIndexLoc();
				c.toTopBind();
				c.toRecommend()
			} catch(d) {
				c.log("", d)
			}
			c.searchhandler();
			c.imgLazyLad.lazyLad(true);
			c.sliderlazyload();
			c.thread.start();
			c.floatLayerRender();
			c.navigationhandler();
			c.topLayerRender()
		},
		log: function(c, d) {
			console.log("Opps!Something Wrong!Please notice it!--" + c + ",error:" + d)
		}
	});
	a.clazz = b
});
M.define("touchHandlerX", function(b) {
	var a = function(d) {
		this.init(d)
	};
	M.object.merge(a.prototype, {
		init: function(d) {
			c.target = null;
			c.noscroll = false;
			c.direct = 0;
			c.basegap = 0;
			c.endfn = function() {};
			c.movefn = function() {};
			c.startfn = function() {};
			c.prefix = "-webkit-";
			if(d != null && M.object.isObject(d)) {
				M.object.merge(c, d)
			}
		},
		getX: function(f) {
			var e = this;
			if(!!!f) {
				f = e.tar
			}
			var d = $(f).css("transform");
			if(!d) {
				d = $(f).css("-webkit-transform")
			}
			if(d == "none") {
				d = 0
			} else {
				d = d.replace("translate3d(", "").replace(",0px,0px)", "");
				d = parseFloat(d, 10)
			}
			if(!d) {
				d = 0
			}
			return d
		},
		goToEnd: function(g, f, k, h) {
			var d = this;
			var e = null;
			var l = null;
			var j = g < 0 ? g : 0;
			var i = g < 0 ? (-k) : 0;
			e = {
				transform: "translate3d(" + j + "px,0px,0px)",
				transition: "0.3s ease 0s"
			};
			l = {
				transform: "translate3d(" + i + "px,0px,0px)"
			};
			if(g != 0) {
				d.css($(f), e);
				setTimeout(function() {
					d.css($(f), l);
					if(h) {
						h(i)
					}
				}, 200);
				return true
			}
		},
		css: function(g, h) {
			var f = c.prefix;
			var e = {};
			for(var d in h) {
				if(typeof(d) == "string") {
					e[f + d] = h[d];
					e[d] = h[d]
				}
			}
			g.css(e)
		},
		fixetRootWidth: function(d) {
			this.rootWidth = d;
			this.screenWidth = $(this.tar).parent().width();
			this.bannerWidth = this.rootWidth + this.screenWidth
		},
		getAnimationobj: function(k) {
			var j = k < 0 ? -1 : 1;
			k = Math.abs(k);
			var h = [],
				f = 0,
				d = 1;
			var e = this.screenWidth;
			var i = this.basegap * j;
			e = [i, i * 2];
			if(!!this.shortmove) {
				return [i, d * 0.5]
			}
			if(k > 0 && k <= e[0]) {
				h.push(i);
				h.push(d * 0.5)
			} else {
				if(k > e[0] && k <= e[1]) {
					h.push(i * 2);
					h.push(d * 0.5)
				} else {
					if(k > e[1]) {
						h.push(i * 3);
						h.push(d * 0.6)
					}
				}
			}
			return h
		},
		animateX: function(d, e) {
			var f = {
				transform: "translate3d(" + d + "px,0px,0px)",
				transition: "-webkit-transform " + e + "s cubic-bezier(0.333333, 0.666667, 0.666667, 1)"
			};
			this.css($(this.tar), f)
		},
		gotoX: function(f, d) {
			var e = this;
			if(!!!f) {
				f = this.tar
			}
			e.css($(f), {
				transform: "translate3d(" + d + "px,0px,0px)"
			})
		},
		getObj: function() {
			return this.tar
		},
		run: function() {
			var l = this;
			var k = c.target;
			var e = $(k);
			l.tar = k;
			l.basegap = c.basegap;
			var i = null;
			var m = {};
			var f = 0;
			l.screenWidth = e.parent().width();
			l.rootWidth = $(k).width() - l.screenWidth;
			rootWidth = l.rootWidth;
			var d = [];
			var j = function(t) {
				if(c.other) {
					for(var r = 0, x = c.other.length; r < x; r++) {
						c.other[r].play()
					}
				}
				var p = false;
				var A = Date.now();
				if(A - m.lastdate >= 1) {
					p = true
				}
				if(i == 1) {
					i = 0;
					return
				}
				var q = t.changedTouches[0];
				var s = q.clientX;
				var z = m.initx + s - m.startx;
				if(z > 0 || z < (-1 * l.rootWidth)) {
					var w = null;
					if(m.initx - m.startx < -l.rootWidth) {
						w = c.endfn
					}
					d.push(setTimeout(function() {
						l.goToEnd(z, k, l.rootWidth, w)
					}, 50));
					return
				}
				var y = s - m.startx;
				l.shortmove = (y <= l.basegap && y >= -l.basegap) ? true : false;
				if(p) {
					l.shortmove = true
				}
				var v = l.getAnimationobj(y);
				var u = (l.shortmove && v[0] > 0) ? 0 : v[0];
				var o = z - (z % l.basegap) + u;
				if(o > 0 || o < (-1 * l.rootWidth)) {
					var w = null;
					if(m.initx - m.startx < -l.rootWidth) {
						w = c.endfn
					}
					setTimeout(function() {
						l.goToEnd(o, k, l.rootWidth, w)
					}, 50);
					return
				}
				var n = setTimeout(function() {
					l.animateX(o, v[1])
				}, 0);
				d.push(n);
				m.lastmovesX = o
			};
			e.off("touchend", j);
			e.on("touchend", j);
			var h = function(q) {
				var s = q.targetTouches[0];
				var o = s.pageY;
				var p = s.pageX;
				m.diry = o - m.starty;
				m.dirx = p - m.startx;
				if(Math.abs(m.dirx) < Math.abs(m.diry)) {
					i = 1
				} else {
					var n = Date.now();
					m.lastdate = n;
					var r = m.initx + p - m.startx;
					r = r > 0 ? 0 : r;
					l.gotoX(e, r);
					l.preventDefault()
				}
			};
			e.off("touchmove", h);
			e.on("touchmove", h);
			var g = function(p) {
				if(c.other) {
					for(var o = 0, n = c.other.length; o < n; o++) {
						c.other[o].pause()
					}
				}
				$(k).css("transition", "");
				$(k).css("-webkit-transition", "");
				for(var o = 0, n = d.length; o < n; o++) {
					clearTimeout(d[o])
				}
				var q = p.targetTouches[0];
				m.starty = q.pageY;
				m.startx = q.pageX;
				m.initx = l.getX(k);
				m.scrollx = 0;
				m.lastX = 0;
				m.lastdate = 0;
				if(!!!m.lastmovesX) {
					m.lastmovesX = 0
				}
			};
			e.off("touchstart", g);
			e.on("touchstart", g)
		},
		preventDefault: function(d) {
			if(d && ev.preventDefault) {
				d.preventDefault()
			} else {
				window.event.returnValue = false
			}
			return false
		},
		touchEndfn: function(d) {
			c.endfn = M.object.isFunction(d) ? d : null
		},
		touchMovefn: function(d) {
			c.movefn = M.object.isFunction(d) ? d : null
		},
		touchStartfn: function(d) {
			c.startfn = M.object.isFunction(d) ? d : null
		},
		touchfn: function(d) {
			if(M.object.isObject(d)) {
				M.object.merge(c, d)
			}
		}
	});
	var c = a;
	b.clazz = a
});
var ceshi = 0;

function debug(a) {
	document.getElementById("index_newkeyword").value = a
};